Exemplo n.º 1
0
        public void DoCommand(object commandTag)
        {
            if (!(commandTag is Command))
            {
                return;
            }

            switch ((Command)commandTag)
            {
            case Command.GlobalVariableFilter:
            {
                var form =
                    new SledLuaVariableFilterForm
                {
                    LocalFilterTypes  = m_globalVariableFilterState.LocalFilterTypes,
                    LocalFilterNames  = m_globalVariableFilterState.LocalFilterNames,
                    TargetFilterTypes = m_globalVariableFilterState.NetFilterTypes,
                    TargetFilterNames = m_globalVariableFilterState.NetFilterNames,
                    Text = Localization.SledLuaVariableFilterGlobalTitle
                };
                form.ShowDialog(m_mainForm);
                if (form.LocalFilterStateChanged)
                {
                    RefilterVars(SledLuaSchema.SledLuaVarGlobalType.Type);
                }
                if (form.TargetFilterStateChanged)
                {
                    SendNetVarFilterState(true);
                }
                if (form.LocalFilterStateChanged || form.TargetFilterStateChanged)
                {
                    SaveVarFilters(null);
                }
            }
            break;

            case Command.LocalVariableFilter:
            {
                var form =
                    new SledLuaVariableFilterForm
                {
                    LocalFilterTypes  = m_localVariableFilterState.LocalFilterTypes,
                    LocalFilterNames  = m_localVariableFilterState.LocalFilterNames,
                    TargetFilterTypes = m_localVariableFilterState.NetFilterTypes,
                    TargetFilterNames = m_localVariableFilterState.NetFilterNames,
                    Text = Localization.SledLuaVariableFilterLocalTitle
                };
                form.ShowDialog(m_mainForm);
                if (form.LocalFilterStateChanged)
                {
                    RefilterVars(SledLuaSchema.SledLuaVarLocalType.Type);
                }
                if (form.TargetFilterStateChanged)
                {
                    SendNetVarFilterState(true);
                }
                if (form.LocalFilterStateChanged || form.TargetFilterStateChanged)
                {
                    SaveVarFilters(null);
                }
            }
            break;

            case Command.UpvalueVariableFilter:
            {
                var form =
                    new SledLuaVariableFilterForm
                {
                    LocalFilterTypes  = m_upvalueVariableFilterState.LocalFilterTypes,
                    LocalFilterNames  = m_upvalueVariableFilterState.LocalFilterNames,
                    TargetFilterTypes = m_upvalueVariableFilterState.NetFilterTypes,
                    TargetFilterNames = m_upvalueVariableFilterState.NetFilterNames,
                    Text = Localization.SledLuaVariableFilterUpvalueTitle
                };
                form.ShowDialog(m_mainForm);
                if (form.LocalFilterStateChanged)
                {
                    RefilterVars(SledLuaSchema.SledLuaVarUpvalueType.Type);
                }
                if (form.TargetFilterStateChanged)
                {
                    SendNetVarFilterState(true);
                }
                if (form.LocalFilterStateChanged || form.TargetFilterStateChanged)
                {
                    SaveVarFilters(null);
                }
            }
            break;

            case Command.EnvironmentVariableFilter:
            {
                var form =
                    new SledLuaVariableFilterForm
                {
                    LocalFilterTypes  = m_envVarVariableFilterState.LocalFilterTypes,
                    LocalFilterNames  = m_envVarVariableFilterState.LocalFilterNames,
                    TargetFilterTypes = m_envVarVariableFilterState.NetFilterTypes,
                    TargetFilterNames = m_envVarVariableFilterState.NetFilterNames,
                    Text = Localization.SledLuaVariableFilterEnvVarTitle
                };
                form.ShowDialog(m_mainForm);
                if (form.LocalFilterStateChanged)
                {
                    RefilterVars(SledLuaSchema.SledLuaVarEnvType.Type);
                }
                if (form.TargetFilterStateChanged)
                {
                    SendNetVarFilterState(true);
                }
                if (form.LocalFilterStateChanged || form.TargetFilterStateChanged)
                {
                    SaveVarFilters(null);
                }
            }
            break;
            }
        }
Exemplo n.º 2
0
        public void DoCommand(object commandTag)
        {
            if (!(commandTag is Command))
                return;

            switch ((Command)commandTag)
            {
                case Command.GlobalVariableFilter:
                {
                    var form =
                        new SledLuaVariableFilterForm
                            {
                                LocalFilterTypes = m_globalVariableFilterState.LocalFilterTypes,
                                LocalFilterNames = m_globalVariableFilterState.LocalFilterNames,
                                TargetFilterTypes = m_globalVariableFilterState.NetFilterTypes,
                                TargetFilterNames = m_globalVariableFilterState.NetFilterNames,
                                Text = Localization.SledLuaVariableFilterGlobalTitle
                            };
                    form.ShowDialog(m_mainForm);
                    if (form.LocalFilterStateChanged)
                        RefilterVars(SledLuaSchema.SledLuaVarGlobalType.Type);
                    if (form.TargetFilterStateChanged)
                        SendNetVarFilterState(true);
                    if (form.LocalFilterStateChanged || form.TargetFilterStateChanged)
                        SaveVarFilters(null);
                }
                break;

                case Command.LocalVariableFilter:
                {
                    var form =
                        new SledLuaVariableFilterForm
                            {
                                LocalFilterTypes = m_localVariableFilterState.LocalFilterTypes,
                                LocalFilterNames = m_localVariableFilterState.LocalFilterNames,
                                TargetFilterTypes = m_localVariableFilterState.NetFilterTypes,
                                TargetFilterNames = m_localVariableFilterState.NetFilterNames,
                                Text = Localization.SledLuaVariableFilterLocalTitle
                            };
                    form.ShowDialog(m_mainForm);
                    if (form.LocalFilterStateChanged)
                        RefilterVars(SledLuaSchema.SledLuaVarLocalType.Type);
                    if (form.TargetFilterStateChanged)
                        SendNetVarFilterState(true);
                    if (form.LocalFilterStateChanged || form.TargetFilterStateChanged)
                        SaveVarFilters(null);
                }
                break;

                case Command.UpvalueVariableFilter:
                {
                    var form =
                        new SledLuaVariableFilterForm
                            {
                                LocalFilterTypes = m_upvalueVariableFilterState.LocalFilterTypes,
                                LocalFilterNames = m_upvalueVariableFilterState.LocalFilterNames,
                                TargetFilterTypes = m_upvalueVariableFilterState.NetFilterTypes,
                                TargetFilterNames = m_upvalueVariableFilterState.NetFilterNames,
                                Text = Localization.SledLuaVariableFilterUpvalueTitle
                            };
                    form.ShowDialog(m_mainForm);
                    if (form.LocalFilterStateChanged)
                        RefilterVars(SledLuaSchema.SledLuaVarUpvalueType.Type);
                    if (form.TargetFilterStateChanged)
                        SendNetVarFilterState(true);
                    if (form.LocalFilterStateChanged || form.TargetFilterStateChanged)
                        SaveVarFilters(null);
                }
                break;

                case Command.EnvironmentVariableFilter:
                {
                    var form =
                        new SledLuaVariableFilterForm
                            {
                                LocalFilterTypes = m_envVarVariableFilterState.LocalFilterTypes,
                                LocalFilterNames = m_envVarVariableFilterState.LocalFilterNames,
                                TargetFilterTypes = m_envVarVariableFilterState.NetFilterTypes,
                                TargetFilterNames = m_envVarVariableFilterState.NetFilterNames,
                                Text = Localization.SledLuaVariableFilterEnvVarTitle
                            };
                    form.ShowDialog(m_mainForm);
                    if (form.LocalFilterStateChanged)
                        RefilterVars(SledLuaSchema.SledLuaVarEnvType.Type);
                    if (form.TargetFilterStateChanged)
                        SendNetVarFilterState(true);
                    if (form.LocalFilterStateChanged || form.TargetFilterStateChanged)
                        SaveVarFilters(null);
                }
                break;
            }
        }