Ejemplo n.º 1
0
        public static void SetPicture(Assembly assembly, _CommandBarButton button, string resource, string masked)
        {
            using (Stream imageStream = assembly.GetManifestResourceStream(resource))
            {
                button.Picture = (StdPicture)PictureHost.IPictureDisp(Image.FromStream(imageStream));
#if !NET_4_0
                using (Stream imageStreamMask = assembly.GetManifestResourceStream(masked))
                {
                    button.Mask = (StdPicture)PictureHost.IPictureDisp(Image.FromStream(imageStreamMask));
                }
#endif
            }
        }
Ejemplo n.º 2
0
		private void ConnectToDatabaseOrServer(_CommandBarButton Ctrl)
		{
			try
			{
				Assembly assembly = Assembly.GetExecutingAssembly();
                if (Ctrl.Caption.Equals(CONNECT))
                {

                    ViewBase.ApplicationObject = _applicationObject;
                    Login.CreateLoginToolWindow(connectDatabaseMenu, connectDatabaseButton, assembly, omBackupControl,
                                                dbCreateDemoDbControl);
                }
                else
                {

                    Helper.SaveDataIfRequired();
                    try
                    {
                        Helper.SetPicture(assembly, (CommandBarButton)connectDatabaseMenu.Control, IMAGE_CONNECT, IMAGE_CONNECT_MASKED);
                    }
                    catch (Exception)
                    {
                    }
                    try
                    {
                        Helper.SetPicture(assembly, connectDatabaseButton, IMAGE_CONNECT, IMAGE_CONNECT_MASKED);
                    }
                    catch (Exception)
                    {
                    }

                    connectDatabaseMenu.Caption = connectDatabaseButton.Caption = CONNECT;
                    connectDatabaseMenu.TooltipText = connectDatabaseButton.TooltipText = CONNECT;
#if !NET_4_0

                    connectDatabaseButton.State = ((CommandBarButton)connectDatabaseMenu).State = MsoButtonState.msoButtonUp;
#endif
                    dbCreateDemoDbControl.Enabled = true;
                    omBackupControl.Enabled = false;

                    CloseAllToolWindows();
                    
                }
			}
			catch (Exception oEx)
			{
				LoggingHelper.HandleException(oEx);
			}
		}
Ejemplo n.º 3
0
		public static void SetPicture(Assembly assembly, _CommandBarButton button, string resource, string masked)
		{
			using (Stream imageStream = assembly.GetManifestResourceStream(resource))
			{
				button.Picture = (StdPicture)PictureHost.IPictureDisp(Image.FromStream(imageStream));
#if !NET_4_0
				using (Stream imageStreamMask = assembly.GetManifestResourceStream(masked))
				{
                    button.Mask = (StdPicture)PictureHost.IPictureDisp(Image.FromStream(imageStreamMask));
				}
#endif
			}
		}