Esempio n. 1
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mThemeImage = (CustomPictureBox)target;
                break;

            case 2:
                this.mThemeName = (TextBlock)target;
                break;

            case 3:
                this.mThemeCheckButton = (CustomButton)target;
                break;

            case 4:
                this.mThemeAppliedText = (TextBlock)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.CloseBtn = (CustomPictureBox)target;
                this.CloseBtn.PreviewMouseDown  += new MouseButtonEventHandler(this.CloseBtn_PreviewMouseDown);
                this.CloseBtn.MouseLeftButtonUp += new MouseButtonEventHandler(this.CloseBtn_MouseLeftButtonUp);
                break;

            case 2:
                this.SigninLaterBtn        = (CustomButton)target;
                this.SigninLaterBtn.Click += new RoutedEventHandler(this.SigninLaterBtn_Click);
                break;

            case 3:
                this.SigninBtn        = (CustomButton)target;
                this.SigninBtn.Click += new RoutedEventHandler(this.SigninBtn_Click);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
Esempio n. 3
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mBorder            = (Border)target;
                this.mBorder.MouseDown += new MouseButtonEventHandler(this.DraggableGrid_MouseDown);
                break;

            case 2:
                this.MinimizeBtn = (CustomPictureBox)target;
                this.MinimizeBtn.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.MinimizeBtn_PreviewMouseLeftButtonUp);
                break;

            case 3:
                this.mProgressText = (TextBlock)target;
                break;

            case 4:
                this.mProgressBar = (BlueProgressBar)target;
                break;

            case 5:
                this.CancelGrid = (CustomButton)target;
                this.CancelGrid.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.CancelGrid_MouseLeftButtonUp);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            string str = Interaction.InputBox("Theme name", "BlueStacks Theme Editor Tool", string.Format((IFormatProvider)CultureInfo.CurrentCulture, "{0:F}", (object)DateTime.Now), 0, 0);

            if (Directory.Exists(Path.Combine(RegistryManager.Instance.ClientInstallDir, str)))
            {
                int num = (int)System.Windows.MessageBox.Show("Already Exists. Please retry");
            }
            else
            {
                Directory.CreateDirectory(Path.Combine(RegistryManager.Instance.ClientInstallDir, str));
                ThemeEditorWindow.CopyEverything(this.DraftDirectory, Path.Combine(RegistryManager.Instance.ClientInstallDir, str));
                RegistryManager.Instance.SetClientThemeNameInRegistry(str);
                Window w = (Window)BlueStacksUIUtils.DictWindows.Values.ToList <MainWindow>()[0];
                w.Dispatcher.Invoke((Delegate)(() =>
                {
                    RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap((int)w.ActualWidth, (int)w.ActualHeight, 0.0, 0.0, PixelFormats.Pbgra32);
                    renderTargetBitmap.Render((Visual)BlueStacksUIUtils.DictWindows.Values.ToList <MainWindow>()[0]);
                    PngBitmapEncoder pngBitmapEncoder = new PngBitmapEncoder();
                    pngBitmapEncoder.Frames.Add(BitmapFrame.Create((BitmapSource)renderTargetBitmap));
                    using (Stream stream = (Stream)File.Create(Path.Combine(CustomPictureBox.AssetsDir, "ThemeThumbnail.png")))
                        pngBitmapEncoder.Save(stream);
                }));
                BlueStacksUIColorManager.AppliedTheme.Save(BlueStacksUIColorManager.GetThemeFilePath(RegistryManager.ClientThemeName));
                CustomPictureBox.UpdateImagesFromNewDirectory("");
            }
        }
Esempio n. 5
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                ((UIElement)target).MouseUp    += new MouseButtonEventHandler(this.Recommendation_Click);
                ((UIElement)target).MouseEnter += new MouseEventHandler(this.UserControl_MouseEnter);
                ((UIElement)target).MouseLeave += new MouseEventHandler(this.UserControl_MouseLeave);
                break;

            case 2:
                this.recomIcon = (CustomPictureBox)target;
                break;

            case 3:
                this.appNameTextBlock = (TextBlock)target;
                break;

            case 4:
                this.installButton        = (CustomButton)target;
                this.installButton.Click += new RoutedEventHandler(this.Recommendation_Click);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mGrid = (Grid)target;
                break;

            case 2:
                this.mChangeThemeWindowIcon = (CustomPictureBox)target;
                break;

            case 3:
                this.mLblBlueStacksChangeTheme = (TextBlock)target;
                break;

            case 4:
                this.mCrossButton = (CustomPictureBox)target;
                this.mCrossButton.MouseLeftButtonUp += new MouseButtonEventHandler(this.mCrossButton_MouseLeftButtonUp);
                this.mCrossButton.PreviewMouseDown  += new MouseButtonEventHandler(this.mCrossButton_PreviewMouseDown);
                break;

            case 5:
                this.mThemesDrawerScrollBar = (ScrollViewer)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
Esempio n. 7
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mGrid = (Grid)target;
                break;

            case 2:
                this.mBrowserGrid = (Grid)target;
                break;

            case 3:
                this.mCloseButtonGrid = (Grid)target;
                this.mCloseButtonGrid.MouseLeftButtonUp += new MouseButtonEventHandler(this.CloseButtonGrid_MouseLeftButtonUp);
                break;

            case 4:
                this.mCloseButton = (CustomPictureBox)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                ((FrameworkElement)target).Loaded += new RoutedEventHandler(this.CustomWindow_Loaded);
                break;

            case 2:
                this.mMaskBorder = (Border)target;
                break;

            case 3:
                this.mBrowserGrid = (Grid)target;
                break;

            case 4:
                this.mCloseButton = (CustomPictureBox)target;
                this.mCloseButton.MouseLeftButtonUp += new MouseButtonEventHandler(this.CloseButton_MouseLeftButtonUp);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mBorder = (Border)target;
                break;

            case 2:
                this.clipMask = (Border)target;
                break;

            case 3:
                this.mGrid = (Grid)target;
                break;

            case 4:
                this.lbl = (Label)target;
                break;

            case 5:
                this.img = (CustomPictureBox)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mTitleText = (TextBlock)target;
                break;

            case 2:
                this.mBodyText = (TextBlock)target;
                break;

            case 3:
                this.mImage = (CustomPictureBox)target;
                break;

            case 4:
                this.mHyperLink = (Hyperlink)target;
                this.mHyperLink.RequestNavigate += new RequestNavigateEventHandler(this.Hyperlink_RequestNavigate);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
Esempio n. 11
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mContentGrid = (Grid)target;
                break;

            case 2:
                this.mBackground = (CustomPictureBox)target;
                break;

            case 3:
                this.mFrontendPopupControl = (FrontendPopupControl)target;
                break;

            case 4:
                this.mPromotionGrid = (Grid)target;
                break;

            case 5:
                this.mPromotionControl = (PromotionControl)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mMainGrid             = (Grid)target;
                this.mMainGrid.MouseEnter += new MouseEventHandler(this.UserControl_MouseEnter);
                this.mMainGrid.MouseLeave += new MouseEventHandler(this.UserControl_MouseLeave);
                this.mMainGrid.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.Recommendation_Click);
                break;

            case 2:
                this.recomIcon = (CustomPictureBox)target;
                break;

            case 3:
                this.appNameTextBlock = (TextBlock)target;
                break;

            case 4:
                this.appGenreTextBlock = (TextBlock)target;
                break;

            case 5:
                this.installButton = (CustomButton)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
Esempio n. 13
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mMaskBorder = (Border)target;
                break;

            case 2:
                this.mRecordingImage = (CustomPictureBox)target;
                break;

            case 3:
                this.mDescriptionPanel = (StackPanel)target;
                break;

            case 4:
                this.mRunningVideo = (TextBlock)target;
                break;

            case 5:
                this.mTimerDisplay = (TextBlock)target;
                break;

            case 6:
                this.mStopVideoRecordImg = (CustomPictureBox)target;
                this.mStopVideoRecordImg.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.StopRecord_PreviewMouseLeftButtonUp);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
Esempio n. 14
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                ((UIElement)target).MouseEnter       += new MouseEventHandler(this.Image_MouseEnter);
                ((UIElement)target).MouseLeave       += new MouseEventHandler(this.Image_MouseLeave);
                ((UIElement)target).PreviewMouseDown += new MouseButtonEventHandler(this.Image_PreviewMouseDown);
                ((UIElement)target).MouseMove        += new MouseEventHandler(this.Image_MouseMove);
                ((UIElement)target).PreviewMouseUp   += new MouseButtonEventHandler(this.Image_PreviewMouseUp);
                break;

            case 2:
                this.mBorder = (Border)target;
                break;

            case 3:
                this.mDragImage = (CustomPictureBox)target;
                break;

            case 4:
                this.mImage = (CustomPictureBox)target;
                break;

            case 5:
                this.mActionHeader = (TextBlock)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
Esempio n. 15
0
        public BufferView(CLAPI instance, FLBuffer buffer, int width, int height)
        {
            Instance = instance;
            InitializeComponent();

            if (buffer.Depth == 1)
            {
                nudFrame.Enabled = false;
            }
            else
            {
                nudFrame.Minimum = 0;
                nudFrame.Maximum = buffer.Depth - 1;
            }

            pbBufferContent = CreatePreviewBox(panelImage);
            Buffer          = buffer;
            this.width      = width;
            this.height     = height;
            Text            = buffer.DefinedBufferName + $"[{buffer.Buffer}]";


            cbImageFilterMode.Items.AddRange(Enum.GetNames(typeof(InterpolationMode)));
            cbImageFilterMode.Items.Remove(InterpolationMode.Invalid.ToString());
            cbImageFilterMode.SelectedIndex = 0;

            StyleManager.RegisterControls(this);

            Icon = FLEditorPluginHost.FLEditorIcon;

            pbIdle.Image    = FLEditorPluginHost.FLEditorImage;
            pbLoading.Image = FLEditorPluginHost.LoadingImage;

            RefreshImage(Instance);
        }
Esempio n. 16
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.CloseBtn = (CustomPictureBox)target;
                this.CloseBtn.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.CloseBtn_PreviewMouseLeftButtonUp);
                break;

            case 2:
                this.mEnableVt = (SpeedUpBluestacksUserControl)target;
                break;

            case 3:
                this.mConfigureAntivirus = (SpeedUpBluestacksUserControl)target;
                break;

            case 4:
                this.mDiasbleHyperV = (SpeedUpBluestacksUserControl)target;
                break;

            case 5:
                this.mPowerPlan = (SpeedUpBluestacksUserControl)target;
                break;

            case 6:
                this.mUpgradeComputer = (SpeedUpBluestacksUserControl)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mControlGrid = (Grid)target;
                break;

            case 2:
                this.mTopBar = (Grid)target;
                break;

            case 3:
                this.mBackButton = (CustomPictureBox)target;
                this.mBackButton.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.BackButton_PreviewMouseLeftButtonUp);
                break;

            case 4:
                this.mTitleLabel = (Label)target;
                break;

            case 5:
                this.mCloseButton = (CustomPictureBox)target;
                this.mCloseButton.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.CloseButton_PreviewMouseLeftButtonUp);
                break;

            case 6:
                this.mControlParentGrid = (Grid)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
Esempio n. 18
0
        private static void AnimateImage(CustomPictureBox image, string imagePath)
        {
            TimeSpan        timeSpan1       = TimeSpan.FromSeconds(0.6);
            TimeSpan        timeSpan2       = TimeSpan.FromSeconds(0.6);
            DoubleAnimation fadeInAnimation = new DoubleAnimation(1.0, (Duration)timeSpan1);

            if (image.Source == null)
            {
                image.Opacity         = 1.0;
                image.IsFullImagePath = true;
                image.ImageName       = imagePath;
            }
            else
            {
                if (!(image.ImageName != imagePath))
                {
                    return;
                }
                DoubleAnimation doubleAnimation = new DoubleAnimation(0.0, (Duration)timeSpan2);
                doubleAnimation.Completed += (EventHandler)((o, e) =>
                {
                    image.IsFullImagePath = true;
                    image.ImageName = imagePath;
                    image.BeginAnimation(UIElement.OpacityProperty, (AnimationTimeline)fadeInAnimation);
                });
                image.BeginAnimation(UIElement.OpacityProperty, (AnimationTimeline)doubleAnimation);
            }
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mAppIcon = (CustomPictureBox)target;
                break;

            case 2:
                this.mAppTitle = (TextBlock)target;
                break;

            case 3:
                this.mBellNotificationStatus = (CustomToggleButtonWithState)target;
                this.mBellNotificationStatus.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.mBellNotificationStatus_PreviewMouseLeftButtonUp);
                break;

            case 4:
                this.mDesktopNotificationStatus = (CustomToggleButtonWithState)target;
                this.mDesktopNotificationStatus.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.mDesktopNotificationStatus_PreviewMouseLeftButtonUp);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
        private void pictureBox_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (string.IsNullOrEmpty(this.selectedItem))
            {
                return;
            }
            Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog();
            bool?nullable = openFileDialog.ShowDialog();

            if (!nullable.HasValue || !nullable.Value)
            {
                return;
            }
            string fileName = openFileDialog.FileName;
            string path     = Path.Combine(this.DraftDirectory, this.selectedItem.ToString((IFormatProvider)CultureInfo.InvariantCulture));

            if (!File.Exists(path))
            {
                path += ".png";
            }
            string destFileName = path;

            File.Copy(fileName, destFileName, true);
            CustomPictureBox.UpdateImagesFromNewDirectory(this.DraftDirectory);
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mMaskBorder = (Border)target;
                break;

            case 2:
                this.mParentGrid = (Grid)target;
                break;

            case 3:
                this.mTextBlockGrid = (Grid)target;
                break;

            case 4:
                this.mCustomMessageBoxCloseButton = (CustomPictureBox)target;
                this.mCustomMessageBoxCloseButton.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.Close_PreviewMouseLeftButtonUp);
                break;

            case 5:
                this.mTitleText = (TextBlock)target;
                break;

            case 6:
                this.mTitleIcon = (CustomPictureBox)target;
                break;

            case 7:
                this.mBodyTextBlock = (TextBlock)target;
                break;

            case 8:
                this.mHintGrid = (Grid)target;
                break;

            case 9:
                this.mHintTextBlock = (TextBlock)target;
                break;

            case 10:
                this.mHintGrid1 = (Grid)target;
                break;

            case 11:
                this.mHintTextBlock1 = (TextBlock)target;
                break;

            case 12:
                this.mButton        = (CustomButton)target;
                this.mButton.Click += new RoutedEventHandler(this.mGetButton_Click);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mNotificationDrawer = (NotificationDrawer)target;
                break;

            case 2:
                this.grdImportantUpdates = (Grid)target;
                break;

            case 3:
                this.mImportantNotificationScroll = (ScrollViewer)target;
                break;

            case 4:
                this.grdNormalUpdates = (Grid)target;
                break;

            case 5:
                this.mNotificationText = (TextBlock)target;
                break;

            case 6:
                ((ButtonBase)target).Click += new RoutedEventHandler(this.ClearButton_Click);
                break;

            case 7:
                this.mSettingsbtn = (CustomPictureBox)target;
                this.mSettingsbtn.MouseLeftButtonUp += new MouseButtonEventHandler(this.mSettingsbtn_MouseLeftButtonUp);
                break;

            case 8:
                this.mSnoozeInfoGrid = (Grid)target;
                break;

            case 9:
                this.mSnoozeInfoBlock = (TextBlock)target;
                break;

            case 10:
                this.mNotificationScroll = (ScrollViewer)target;
                break;

            case 11:
                this.noNotifControl = (Grid)target;
                break;

            case 12:
                this.mAnimationRect = (Rectangle)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
 private void ListViewItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (this.ListView2.SelectedItem == null)
     {
         return;
     }
     this.selectedItem = this.ListView2.SelectedItem.ToString();
     CustomPictureBox.SetBitmapImage(this.pictureBox, this.ListView2.SelectedItem.ToString(), false);
 }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mTitle = (Label)target;
                break;

            case 2:
                this.mSubTitle = (Label)target;
                break;

            case 3:
                this.mDownloadButton        = (CustomButton)target;
                this.mDownloadButton.Click += new RoutedEventHandler(this.mDownloadButton_Click);
                break;

            case 4:
                this.mCloseBtn = (CustomPictureBox)target;
                this.mCloseBtn.MouseLeftButtonUp += new MouseButtonEventHandler(this.CloseBtn_MouseLeftButtonUp);
                break;

            case 5:
                ((FrameworkElement)target).Initialized += new EventHandler(this.TagLine_Initialized);
                break;

            case 6:
                ((FrameworkElement)target).Initialized += new EventHandler(this.Description_Initialized);
                break;

            case 7:
                ((FrameworkElement)target).Initialized += new EventHandler(this.FeaturesStack_Initialized);
                break;

            case 8:
                ((FrameworkElement)target).Initialized += new EventHandler(this.FeaturesText_Initialized);
                break;

            case 9:
                ((FrameworkElement)target).Initialized += new EventHandler(this.DetailsStack_Initialized);
                break;

            case 10:
                ((FrameworkElement)target).Initialized += new EventHandler(this.DetailsText_Initialized);
                break;

            case 11:
                this.slideShow = (SlideShowControl)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
Esempio n. 25
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.clipMask = (Border)target;
                break;

            case 2:
                this.mProgressWindowGrid = (Grid)target;
                break;

            case 3:
                this.mLastRow = (RowDefinition)target;
                break;

            case 4:
                ((UIElement)target).MouseDown += new MouseButtonEventHandler(this.DraggableGrid_MouseDown);
                break;

            case 5:
                ((UIElement)target).MouseDown += new MouseButtonEventHandler(this.DraggableGrid_MouseDown);
                break;

            case 6:
                this.MinimizeBtn = (CustomPictureBox)target;
                this.MinimizeBtn.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.MinimizeBtn_PreviewMouseLeftButtonUp);
                break;

            case 7:
                ((UIElement)target).MouseDown += new MouseButtonEventHandler(this.DraggableGrid_MouseDown);
                break;

            case 8:
                this.mProgressHeader = (TextBlock)target;
                break;

            case 9:
                this.mProgressText = (TextBlock)target;
                break;

            case 10:
                this.mProgressBar = (BlueProgressBar)target;
                break;

            case 11:
                this.mBtnGrid = (CustomButton)target;
                this.mBtnGrid.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.CancelBtn_MouseLeftButtonUp);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
 private void BusyImage_Initialized(object sender, EventArgs e)
 {
     if (this.mBusyImage == null)
     {
         this.mBusyImage = sender as CustomPictureBox;
     }
     if (string.IsNullOrEmpty(this.mImageName))
     {
         return;
     }
     this.mBusyImage.ImageName = this.mImageName + this.mBusyImageNamePostFix;
 }
Esempio n. 27
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                ((UIElement)target).AddHandler(Mouse.MouseUpEvent, (Delegate) new MouseButtonEventHandler(this.pikanotificationcontrol_MouseUp));
                ((UIElement)target).MouseEnter    += new MouseEventHandler(this.PikaNotificationControl_MouseEnter);
                ((UIElement)target).MouseLeave    += new MouseEventHandler(this.PikaNotificationControl_MouseLeave);
                ((FrameworkElement)target).Loaded += new RoutedEventHandler(this.UserControl_Loaded);
                break;

            case 2:
                this.mNotificationGrid = (Grid)target;
                break;

            case 3:
                this.ribbonBack = (System.Windows.Shapes.Path)target;
                break;

            case 4:
                this.ribbonStroke = (System.Windows.Shapes.Path)target;
                break;

            case 5:
                this.backgroundPanel = (StackPanel)target;
                break;

            case 6:
                this.pikaGif = (CustomPictureBox)target;
                break;

            case 7:
                this.titleText = (TextBlock)target;
                break;

            case 8:
                this.messageText = (TextBlock)target;
                break;

            case 9:
                this.notificationBorder = (Border)target;
                break;

            case 10:
                this.mCloseBtn = (CustomPictureBox)target;
                this.mCloseBtn.MouseLeftButtonUp += new MouseButtonEventHandler(this.CloseBtn_MouseLeftButtonUp);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
Esempio n. 28
0
        // Metodo para Cargar los bloques.
        private void LoadBlocks()
        {
            // Variables auxiliares para el calculo de tamano de cada cpb
            int xAxis = 10, yAxis = 5;

            remainingBlocks = xAxis * yAxis;

            int pbWidth  = (Width - (xAxis - 5)) / xAxis;
            int pbHeight = (int)(Height * 0.3) / yAxis;

            cpb = new CustomPictureBox[yAxis, xAxis];

            for (int i = 0; i < yAxis; i++)
            {
                for (int j = 0; j < xAxis; j++)
                {
                    cpb[i, j] = new CustomPictureBox();

                    if (i == 0)
                    {
                        cpb[i, j].Hits            = 3;
                        cpb[i, j].BackgroundImage = Image.FromFile("../../Resources/Brick_Lvl3.jpg");
                        cpb[i, j].Tag             = "blockLevel3";
                    }
                    else if (i == 1 || i == 2)
                    {
                        cpb[i, j].Hits            = 2;
                        cpb[i, j].BackgroundImage = Image.FromFile("../../Resources/Brick_Lvl2.jpg");
                        cpb[i, j].Tag             = "blockLevel2";
                    }
                    else
                    {
                        cpb[i, j].Hits            = 1;
                        cpb[i, j].BackgroundImage = Image.FromFile("../../Resources/Brick_Lvl1.jpg");
                        cpb[i, j].Tag             = "blockLevel1";
                    }
                    // Tamano del cpb
                    cpb[i, j].Height = pbHeight;
                    cpb[i, j].Width  = pbWidth;

                    // Posicion de left, y posicion de top
                    cpb[i, j].Left = j * pbWidth;
                    cpb[i, j].Top  = i * pbHeight;
                    cpb[i, j].Top  = i * pbHeight + Scores.Height + 1;

                    cpb[i, j].BackgroundImageLayout = ImageLayout.Stretch;

                    Controls.Add(cpb[i, j]);
                }
            }
        }
        private void LoadTiles()
        {
            int pbWidth  = (Width - xAxis) / xAxis;
            int pbHeight = (int)(Height * 0.3) / yAxis;

            cpb = new CustomPictureBox[yAxis, xAxis];

            for (int i = 0; i < yAxis; i++)
            {
                for (int j = 0; j < xAxis; j++)
                {
                    cpb[i, j] = new CustomPictureBox();

                    if (i == yAxis - 1)
                    {
                        cpb[i, j].Hits = 2;
                    }

                    else
                    {
                        cpb[i, j].Hits = 1;
                    }

                    //Tamano de cpb
                    cpb[i, j].Height = pbHeight;
                    cpb[i, j].Width  = pbWidth;

                    //Posicion de left y top
                    cpb[i, j].Left = j * pbWidth;
                    cpb[i, j].Top  = i * pbHeight + scorePanel.Height + 1;

                    if (i == yAxis - 1)
                    {
                        //Seteando imagen de cpb en i==3
                        cpb[i, j].BackgroundImage = Image.FromFile("../../Resources/tb.png");
                        cpb[i, j].Tag             = "blinded";
                    }

                    else
                    {
                        //Seteando imagen de cpb
                        cpb[i, j].BackgroundImage = Image.FromFile("../../Resources/" + GRN() + ".png");
                        cpb[i, j].Tag             = "tileTag";
                    }

                    cpb[i, j].BackgroundImageLayout = ImageLayout.Stretch;
                    Controls.Add(cpb[i, j]);
                }
            }
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                ((UIElement)target).MouseDown  += new MouseButtonEventHandler(this.ComboBoxItem_MouseDown);
                ((UIElement)target).MouseEnter += new MouseEventHandler(this.ComboBoxItem_MouseEnter);
                ((UIElement)target).MouseLeave += new MouseEventHandler(this.ComboBoxItem_MouseLeave);
                ((UIElement)target).LostFocus  += new RoutedEventHandler(this.ComboBoxItem_LostFocus);
                break;

            case 2:
                this.mSchemeControl = (Grid)target;
                break;

            case 3:
                this.mBookmarkImg            = (CustomPictureBox)target;
                this.mBookmarkImg.MouseDown += new MouseButtonEventHandler(this.Bookmark_img_MouseDown);
                break;

            case 4:
                this.mSchemeName        = (CustomTextBox)target;
                this.mSchemeName.KeyUp += new KeyEventHandler(this.MSchemeName_KeyUp);
                break;

            case 5:
                this.mEditImg            = (CustomPictureBox)target;
                this.mEditImg.MouseDown += new MouseButtonEventHandler(this.EditImg_MouseDown);
                break;

            case 6:
                this.mSaveImg            = (CustomPictureBox)target;
                this.mSaveImg.MouseDown += new MouseButtonEventHandler(this.SaveImg_MouseDown);
                break;

            case 7:
                this.mCopyImg            = (CustomPictureBox)target;
                this.mCopyImg.MouseDown += new MouseButtonEventHandler(this.CopyImg_MouseDown);
                break;

            case 8:
                this.mDeleteImg            = (CustomPictureBox)target;
                this.mDeleteImg.MouseDown += new MouseButtonEventHandler(this.DeleteImg_MouseDown);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
Esempio n. 31
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void aTAN2123456ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form firstForm = new Form();
            firsPictureBox = new CustomPictureBox();
            firsPictureBox.BackColor = Color.White;
            firsPictureBox.Location = new Point(0, 8);
            firsPictureBox.Size = new Size(800, 600);
            firsPictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
            firsPictureBox.BorderStyle = BorderStyle.Fixed3D;
            firstForm.Controls.Add(firsPictureBox);
            firstForm.Show();

            Form secondForm = new Form();
            secondPictureBox = new CustomPictureBox();
            secondPictureBox.BackColor = Color.White;
            secondPictureBox.Location = new Point(0, 8);
            secondPictureBox.Size = new Size(800, 600);
            secondPictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
            secondPictureBox.BorderStyle = BorderStyle.Fixed3D;
            secondForm.Controls.Add(secondPictureBox);
            secondForm.Show();

            double[] fz = new double[4];
            fz[0] = N_fz;
            fz[1] = N_fz2;
            fz[2] = N_fz3;
            fz[3] = N_fz4;
            int n = 3;

            if (fz[3] != 0)
            {
                n = 4;
            }

            img[0] = pictureBox1.Image;
            img[1] = pictureBox2.Image;
            img[2] = pictureBox3.Image;
            img[3] = pictureBox4.Image;

            FazaClass.imageProcessed -= imageProcessedForSecondMethod;
            FazaClass.imageProcessed += imageProcessedForSecondMethod;

            batchProcessingFlag = 0;

            PopupProgressBar.show();

            ThreadPool.QueueUserWorkItem((obj) =>
            {
                FazaClass.Graph_ATAN(img, n, fz, 1);
            });
        }