コード例 #1
0
        public void SetConfig(KeymapOutConfig config)
        {
            this.config = config;
            //this.connection_output_name.Text = config.Output.Name;
            this.connection_output_stack.Children.Clear();

            for (int i = 0; i < config.Stack.Count; i++)
            {
                KeymapOutput     output = config.Stack[i];
                KeymapOutputItem item   = new KeymapOutputItem(output);
                item.AllowDrop    = true;
                item.OnDragStart += item_OnDragStart;
                item.OnDragStop  += item_OnDragStop;
                item.Drop        += output_Drop;
                item.DragEnter   += output_DragEnter;
                item.DragLeave   += output_DragLeave;
                item.Tag          = i;
                this.connection_output_stack.Children.Add(item);
            }

            if (config.Inherited)
            {
                this.connection_output_stack.Opacity = 0.6;
                this.rAdd.Visibility   = Visibility.Hidden;
                this.rClear.Visibility = Visibility.Hidden;
            }
            else
            {
                this.connection_output_stack.Opacity = 1.0;
                this.rAdd.Visibility   = Visibility.Visible;
                this.rClear.Visibility = Visibility.Visible;
            }

            /*
             * if (config.Inherited)
             * {
             *  Color color = KeymapColors.GetColor(config.Output.Type);
             *  color.A = 60;
             *  this.connection_output_border.Background = new SolidColorBrush(color);
             *  this.rClear.Visibility = Visibility.Hidden;
             * }
             * else
             * {
             *  this.connection_output_border.Background = new SolidColorBrush(KeymapColors.GetColor(config.Output.Type));
             *  this.rClear.Visibility = Visibility.Visible;
             * }
             */
            /*if (fromDefault)
             * {
             *  this.rClear.Visibility = Visibility.Hidden;
             * }*/

            if (OnConfigChanged != null)
            {
                OnConfigChanged(this.input, this.config);
            }
        }
コード例 #2
0
        public void SetConfig(KeymapOutConfig config)
        {
            this.config = config;
            //this.connection_output_name.Text = config.Output.Name;
            this.connection_output_stack.Children.Clear();

            for(int i=0; i<config.Stack.Count; i++)
            {
                KeymapOutput output = config.Stack[i];
                KeymapOutputItem item = new KeymapOutputItem(output);
                item.AllowDrop = true;
                item.OnDragStart += item_OnDragStart;
                item.OnDragStop += item_OnDragStop;
                item.Drop += output_Drop;
                item.DragEnter += output_DragEnter;
                item.DragLeave += output_DragLeave;
                item.Tag = i;
                this.connection_output_stack.Children.Add(item);
            }

            if (config.Inherited)
            {
                this.connection_output_stack.Opacity = 0.6;
                this.rAdd.Visibility = Visibility.Hidden;
                this.rClear.Visibility = Visibility.Hidden;
            }
            else
            {
                this.connection_output_stack.Opacity = 1.0;
                this.rAdd.Visibility = Visibility.Visible;
                this.rClear.Visibility = Visibility.Visible;
            }

            /*
            if (config.Inherited)
            {
                Color color = KeymapColors.GetColor(config.Output.Type);
                color.A = 60;
                this.connection_output_border.Background = new SolidColorBrush(color);
                this.rClear.Visibility = Visibility.Hidden;
            }
            else
            {
                this.connection_output_border.Background = new SolidColorBrush(KeymapColors.GetColor(config.Output.Type));
                this.rClear.Visibility = Visibility.Visible;
            }
            */
            /*if (fromDefault)
            {
                this.rClear.Visibility = Visibility.Hidden;
            }*/

            if (OnConfigChanged != null)
            {
                OnConfigChanged(this.input,this.config);
            }
        }
コード例 #3
0
        public KeymapOutputRow(KeymapOutput output)
        {
            InitializeComponent();

            KeymapOutputItem item = new KeymapOutputItem(output);
            item.OnDragStart += item_OnDragStart;
            item.OnDragStop += item_OnDragStop;

            this.mainGrid.Children.Add(item);
        }
コード例 #4
0
        public KeymapOutputRow(KeymapOutput output)
        {
            InitializeComponent();

            KeymapOutputItem item = new KeymapOutputItem(output);

            item.OnDragStart += item_OnDragStart;
            item.OnDragStop  += item_OnDragStop;

            this.mainGrid.Children.Add(item);
        }