예제 #1
0
파일: Filter.cs 프로젝트: marzlia/CXPortal
        public void ApplyFilter(Object passedObj, Object dontCare = null)
        {
            double value = Convert.ToDouble(passedObj);

            if (value == 0)
            {
                Image image = (m_FilterButton.Content as StackPanel).Children[0] as Image;
                image.Source = new BitmapImage(new Uri(@"/L3Filter-DensityAlarm;component/DensityAlarmOff.png", UriKind.Relative));

                if (dockPanel.Effect != null)
                {
                    dockPanel.Effect = null;
                    m_EffectChanged  = true;
                }
            }
            else
            {
                Image image = (m_FilterButton.Content as StackPanel).Children[0] as Image;
                image.Source = new BitmapImage(new Uri(@"/L3Filter-DensityAlarm;component/DensityAlarmOn.png", UriKind.Relative));

                DensityAlarmEffect densityEffect = new DensityAlarmEffect();
                densityEffect.SampleI = value;

                if (dockPanel.Effect == null || (dockPanel.Effect as DensityAlarmEffect).SampleI != value)
                {
                    dockPanel.Effect = densityEffect;
                    m_EffectChanged  = true;
                }
            }

            //var currSliderVal = m_ValueSlider.Value / 100.0;
            //if (currSliderVal != value && m_ValueSlider.IsEnabled)
            //{
            //    m_ValueSlider.IsEnabled = false;
            //    m_ValueSlider.Value = value * 100.0;
            //    m_ValTextBox.Text = (m_ValueSlider.Value).ToString("F0") + " %";
            //    m_ValueSlider.IsEnabled = true;
            //}
        }
예제 #2
0
파일: Filter.cs 프로젝트: BdGL3/CXPortal
        public void ApplyFilter (Object passedObj, Object dontCare = null)
        {
            double value = Convert.ToDouble(passedObj);

            if (value == 0)
            {
                Image image = (m_FilterButton.Content as StackPanel).Children[0] as Image;
                image.Source = new BitmapImage(new Uri(@"/L3Filter-DensityAlarm;component/DensityAlarmOff.png", UriKind.Relative));

                if (dockPanel.Effect != null)
                {
                    dockPanel.Effect = null;
                    m_EffectChanged = true;
                }
            }
            else
            {
                Image image = (m_FilterButton.Content as StackPanel).Children[0] as Image;
                image.Source = new BitmapImage(new Uri(@"/L3Filter-DensityAlarm;component/DensityAlarmOn.png", UriKind.Relative));

                DensityAlarmEffect densityEffect = new DensityAlarmEffect();
                densityEffect.SampleI = value;

                if (dockPanel.Effect == null || (dockPanel.Effect as DensityAlarmEffect).SampleI != value)
                {
                    dockPanel.Effect = densityEffect;
                    m_EffectChanged = true;
                }
            }

            //var currSliderVal = m_ValueSlider.Value / 100.0;
            //if (currSliderVal != value && m_ValueSlider.IsEnabled)
            //{
            //    m_ValueSlider.IsEnabled = false;
            //    m_ValueSlider.Value = value * 100.0;
            //    m_ValTextBox.Text = (m_ValueSlider.Value).ToString("F0") + " %";
            //    m_ValueSlider.IsEnabled = true;
            //}
        }