コード例 #1
0
        private void ButtonNewChannelClick(object sender, RoutedEventArgs e)
        {
            Random r       = new Random();
            int    byte1   = r.Next(254) + 1; // in range [1,254]
            int    byte2   = r.Next(254) + 1; // in range [1,254]
            int    channel = byte1 << 8 | byte2;

            PreferenceBindings p = DataContext as PreferenceBindings;

            p.Channel = (uint)channel;
        }
コード例 #2
0
        public PreferencesWindow(IHelper aHelper, PreferenceBindings aBindings, Model aModel, HelperAutoUpdate aHelperAutoUpdate)
        {
            InitializeComponent();

            iModel            = aModel;
            iHelperAutoUpdate = aHelperAutoUpdate;

            // set the bindings for the window
            DataContext = aBindings;

            // fill in about page info
            textBlockProduct.Text   = aHelper.Product;
            textBlockVersion.Text   = string.Format("Version {0} {1}", aHelper.Version, aHelper.Family);
            textBlockCopyright.Text = aHelper.Copyright;

            MemoryStream iconStream = new MemoryStream();

            ResourceManager.IconSongcaster.Save(iconStream);
            iconStream.Seek(0, SeekOrigin.Begin);
            Icon          = BitmapFrame.Create(iconStream);
            image1.Source = ResourceManager.Icon;
            image2.Source = ResourceManager.ImageRotaryControl;
            image3.Source = ResourceManager.ImageRockerControl;
        }
コード例 #3
0
        private void ButtonVideoLatencyDefaultClick(object sender, RoutedEventArgs e)
        {
            PreferenceBindings p = DataContext as PreferenceBindings;

            p.VideoLatency = iModel.Preferences.DefaultVideoLatencyMs;
        }