예제 #1
1
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="items">List of updates to show</param>
        /// <param name="applicationIcon">The icon</param>
        /// <param name="separatorTemplate">HTML template for every single note. Use {0} = Version. {1} = Date. {2} = Note Body</param>
        /// <param name="headAddition">Additional text they will inserted into HTML Head. For Stylesheets.</param>
        public NetSparkleForm(Sparkle sparkle, NetSparkleAppCastItem[] items, Icon applicationIcon = null, string separatorTemplate = "", string headAddition = "")
        {
            _sparkle = sparkle;
            _updates = items;

            SeparatorTemplate =
                !string.IsNullOrEmpty(separatorTemplate) ?
                separatorTemplate :
                "<div style=\"border: #ccc 1px solid;\"><div style=\"background: {3}; padding: 5px;\"><span style=\"float: right; display:float;\">{1}</span>{0}</div><div style=\"padding: 5px;\">{2}</div></div><br>";

            InitializeComponent();

            // init ui
            try
            {
                NetSparkleBrowser.AllowWebBrowserDrop = false;
                NetSparkleBrowser.AllowNavigation = false;
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error in browser init: " + ex.Message);
            }

            NetSparkleAppCastItem item = items[0];

            lblHeader.Text = lblHeader.Text.Replace("APP", item.AppName);
            lblInfoText.Text = lblInfoText.Text.Replace("APP", item.AppName + " " + item.Version);
            lblInfoText.Text = lblInfoText.Text.Replace("OLDVERSION", getVersion(new Version(item.AppVersionInstalled)));

            if (items.Length == 0)
            {
                RemoveReleaseNotesControls();
            }
            else
            {
                NetSparkleAppCastItem latestVersion = _updates.OrderByDescending(p => p.Version).FirstOrDefault();

                StringBuilder sb = new StringBuilder("<html><head><meta http-equiv='Content-Type' content='text/html;charset=UTF-8'>" + headAddition + "</head><body>");
                foreach (NetSparkleAppCastItem castItem in items)
                {
                    sb.Append(string.Format(SeparatorTemplate,
                                            castItem.Version,
                                            castItem.PublicationDate.ToString("dd MMM yyyy"),
                                            GetReleaseNotes(castItem),
                                            latestVersion.Version.Equals(castItem.Version) ? "#ABFF82" : "#AFD7FF"));
                }
                sb.Append("</body>");

                string releaseNotes = sb.ToString();
                NetSparkleBrowser.DocumentText = releaseNotes;
            }

            if (applicationIcon != null)
            {
                imgAppIcon.Image = new Icon(applicationIcon, new Size(48, 48)).ToBitmap();
                Icon = applicationIcon;
            }

            TopMost = false;
        }
예제 #2
0
        public Main(string[] args)
        {
            InitializeComponent();

            this.Location = new Point(-10000, -10000);

            //using (System.Drawing.Bitmap windowBitmap = ResourceHelper.GetImage("Envelope.png")) {
            //  _IconWindow = Icon.FromHandle(windowBitmap.GetHicon());
            //  this.Icon = _IconWindow;
            //}

            _IconWindow = ResourceHelper.GetIcon("gmail-classic.ico");
            this.Icon = _IconWindow;

            this.Text = this._TrayIcon.Text = GmailNotifierPlus.Resources.WindowTitle;
            this.CreateInstances();

            if (args.Length > 0 && args[0] == Program.Arguments.Settings){
                this.OpenSettingsWindow();
            }

            _Config.Saved += _Config_Saved;

            _Timer.Tick += _Timer_Tick;
            _Timer.Interval = _Config.Interval * 1000;
            _Timer.Enabled = true;
        }
예제 #3
0
 private void RegisterStatusIcon(Icon icon)
 {
     if (icon != Icon.None)
     {
         this.ResourceManager.RegisterClientStyleBlock(icon.ToString() + "-sbar", this.GetIconClass(icon));
     }
 }
    //*************************************************************************
    //  Constructor: NotificationDialog()
    //
    /// <overloads>
    /// Initializes a new instance of the <see
    /// cref="NotificationDialog" /> class.
    /// </overloads>
    ///
    /// <summary>
    /// Initializes a new instance of the <see
    /// cref="NotificationDialog" /> class with a window title, icon, and
    /// notification message.
    /// </summary>
    ///
    /// <param name="title">
    /// Window title.
    /// </param>
    ///
    /// <param name="systemIcon">
    /// Icon to use within the dialog.  Should be a member of the SystemIcons
    /// class.
    /// </param>
    ///
    /// <param name="message">
    /// Notification message.
    /// </param>
    //*************************************************************************

    public NotificationDialog
    (
        String title,
        Icon systemIcon,
        String message
    )
    : this()
    {
        Debug.Assert( !String.IsNullOrEmpty(title) );
        Debug.Assert(systemIcon != null);
        Debug.Assert( !String.IsNullOrEmpty(message) );

        // Instantiate an object that saves and retrieves the size and position
        // settings of this dialog.  Note that the object automatically saves
        // the settings when the form closes.

        m_oNotificationDialogUserSettings =
            new NotificationDialogUserSettings(this);

        this.Text = title;
        picNotification.Image = Bitmap.FromHicon(systemIcon.Handle);
        lblMessage.Text = message;

        DoDataExchange(false);

        AssertValid();
    }
예제 #5
0
		private void OnFormLoad(object sender, EventArgs e)
		{
			GlobalWindowManager.AddWindow(this, this);

			m_lblCopyright.Text = PwDefs.Copyright + ".";

			string strTitle = PwDefs.ProductName;
			string strDesc = KPRes.Version + " " + PwDefs.VersionString;

			Icon icoNew = new Icon(Properties.Resources.KeePass, 48, 48);

			BannerFactory.CreateBannerEx(this, m_bannerImage, icoNew.ToBitmap(),
				strTitle, strDesc);
			this.Icon = Properties.Resources.KeePass;

			m_lvComponents.Columns.Add(KPRes.Component, 100, HorizontalAlignment.Left);
			m_lvComponents.Columns.Add(KPRes.Status + " / " + KPRes.Version, 100,
				HorizontalAlignment.Left);

			try { GetAppComponents(); }
			catch(Exception) { Debug.Assert(false); }

			UIUtil.SetExplorerTheme(m_lvComponents, false);
			UIUtil.ResizeColumns(m_lvComponents, true);
		}
예제 #6
0
        /// <summary>
        /// Launch the Lean Engine Primary Form:
        /// </summary>
        /// <param name="engine">Accept the engine instance we just launched</param>
        public LeanEngineWinForm(Engine engine)
        {
            _engine = engine;
            //Setup the State:
            _resultsHandler = engine.AlgorithmHandlers.Results;

            //Create Form:
            Text = "QuantConnect Lean Algorithmic Trading Engine: v" + Constants.Version;
            Size = new Size(1024,768);
            MinimumSize = new Size(1024, 768);
            CenterToScreen();
            WindowState = FormWindowState.Maximized;
            Icon = new Icon("../../../lean.ico");

            //Setup Console Log Area:
            _console = new RichTextBox();
            _console.Parent = this;
            _console.ReadOnly = true;
            _console.Multiline = true;
            _console.Location = new Point(0, 0);
            _console.Dock = DockStyle.Fill;
            _console.KeyUp += ConsoleOnKeyUp;
            
            //Form Events:
            Closed += OnClosed;

            //Setup Polling Events:
            _polling = new Timer();
            _polling.Interval = 1000;
            _polling.Tick += PollingOnTick;
            _polling.Start();
        }
예제 #7
0
            public static System.Drawing.Icon FromString(string IconName)
            {
                try
                {
                    string IconPath =
                        (new Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase()).Info.DirectoryPath +
                        "\\Icons\\" + IconName + ".ico";

                    if (System.IO.File.Exists(IconPath))
                    {
                        System.Drawing.Icon nI = new System.Drawing.Icon(IconPath);

                        return nI;
                    }
                }
                catch (Exception ex)
                {
                    Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
                                                        (string)
                                                        ("Couldn\'t get Icon from String" + Constants.vbNewLine +
                                                         ex.Message));
                }

                return null;
            }
예제 #8
0
 /// <summary>
 /// Creates a new instance of the menu item
 /// </summary>
 /// <param name="name">The name or text to appear for this item</param>
 /// <param name="icon">The icon to draw for this menu item</param>
 /// <param name="clickHandler">The click event handler</param>
 public SymbologyMenuItem(string name, Icon icon, EventHandler clickHandler)
 {
     MenuItems = new List<SymbologyMenuItem>();
     Name = name;
     ClickHandler = clickHandler;
     Icon = icon;
 }
예제 #9
0
 public void AddExpression(Type type, string containerID, string objectID, string objectType, string objectPath, string objectName, string propertyName, string expression, Icon icon)
 {
     string[] newRow = { containerID, objectID, objectType, objectPath, objectName, propertyName, expression };
     int index = expressionGrid.Rows.Add(newRow);
     expressionGrid.Rows[index].Tag = type;
     expressionGrid.Rows[index].Cells["ObjectType"].Tag = icon;
 }
예제 #10
0
        public Form1()
        {

            _heartbeat = 0;
            InitializeComponent();
            this.WindowState = FormWindowState.Minimized;
            icnStopped = Resources.Icon1;
            icnStarted = Resources.Icon2;

            timestamp = RetrieveLinkerTimestamp();
            Assembly _assembly;
            _assembly = Assembly.GetExecutingAssembly();


            // notifyIcon1.Text = "MTC Multi-SHDR Agent - Release " + _assembly.ImageRuntimeVersion ;
            notifyIcon1.Text = "MTC Agent Simulator - Release " + timestamp.ToLocalTime(); ;
            notifyIcon1.Icon = icnStopped;

            Logger.RestartLog();
            aTimer = new System.Timers.Timer();
            aTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimedEvent);
           // System.Threading.Thread.Sleep(30000);

            MTConnectAgentCore.Configuration.defaultDirectory = Application.StartupPath + "\\";
            MTConnectAgentCore.Configuration.confDirectory = "" ;

            SystemEvents.SessionEnding += SystemEvents_SessionEnding;

         
        }
예제 #11
0
		/// <summary>
		/// Convertit l'icône spécifiée en <see cref="Bitmap" /> de la taille spécifiée.
		/// </summary>
		/// <param name="icon">Icône à convertir.</param>
		/// <param name="size">Taille en pixels de l'image retournée.</param>
		/// <returns>Image de la taille spécifiée qui représente l'icône spécifiée.</returns>
		/// <exception cref="ArgumentNullException">L'icône spécifiée est une référence null.</exception>
		public static Bitmap ToBitmap(this Icon icon, Size size)
		{
			if(icon==null) throw new ArgumentNullException("icon");

			var bitmap=new Icon(icon, size).ToBitmap();
			return bitmap.Size==size ? bitmap : new Bitmap(bitmap, size);
		}
예제 #12
0
 private static BitmapSource LoadBitmap(Icon icon)
 {
     return (icon == null) ? null :
         System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
             icon.ToBitmap().GetHbitmap(), IntPtr.Zero, Int32Rect.Empty,
             System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
 }
예제 #13
0
		void ReadFilesProperties(object sender, DoWorkEventArgs e)
		{
			while(_itemsToRead.Count > 0)
			{
				BaseItem item = _itemsToRead[0];
				_itemsToRead.RemoveAt(0);

				Thread.Sleep(50); //emulate time consuming operation
				if (item is FolderItem)
				{
					DirectoryInfo info = new DirectoryInfo(item.ItemPath);
					item.Date = info.CreationTime;
				}
				else if (item is FileItem)
				{
					FileInfo info = new FileInfo(item.ItemPath);
					item.Size = info.Length;
					item.Date = info.CreationTime;
					if (info.Extension.ToLower() == ".ico")
					{
						Icon icon = new Icon(item.ItemPath);
						item.Icon = icon.ToBitmap();
					}
					else if (info.Extension.ToLower() == ".bmp")
					{
						item.Icon = new Bitmap(item.ItemPath);
					}
				}
				_worker.ReportProgress(0, item);
			}
		}
예제 #14
0
파일: Player.cs 프로젝트: JamieSharpe/GaGa
        /// <summary>
        /// A media player that is controlled from a notify icon
        /// using the mouse. Takes control of the notifyicon icon,
        /// tooltip and balloon to display status.
        /// </summary>
        /// <param name="icon">
        /// The notify icon that controls playback.
        /// </param>
        public Player(NotifyIcon icon)
        {
            notifyIcon = icon;
            notifyIcon.MouseClick += OnMouseClick;

            player = new MediaPlayer();
            player.BufferingStarted += OnBufferingStarted;
            player.BufferingEnded += OnBufferingEnded;
            player.MediaEnded += OnMediaEnded;
            player.MediaFailed += OnMediaFailed;

            source = null;
            isIdle = true;

            idleIcon = Utils.ResourceAsIcon("GaGa.Resources.idle.ico");
            playingIcon = Utils.ResourceAsIcon("GaGa.Resources.playing.ico");
            playingMutedIcon = Utils.ResourceAsIcon("GaGa.Resources.playing-muted.ico");

            bufferingIcons = new Icon[] {
                Utils.ResourceAsIcon("GaGa.Resources.buffering1.ico"),
                Utils.ResourceAsIcon("GaGa.Resources.buffering2.ico"),
                Utils.ResourceAsIcon("GaGa.Resources.buffering3.ico"),
                Utils.ResourceAsIcon("GaGa.Resources.buffering4.ico"),
            };

            bufferingIconTimer = new DispatcherTimer();
            bufferingIconTimer.Interval = TimeSpan.FromMilliseconds(300);
            bufferingIconTimer.Tick += bufferingIconTimer_Tick;

            currentBufferingIcon = 0;

            UpdateIcon();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="sparkle">the sparkle instance</param>
        /// <param name="item"></param>
        /// <param name="appIcon">application icon</param>
        /// <param name="windowIcon">window icon</param>
        /// <param name="Unattend"><c>true</c> if this is an unattended install</param>
        public NetSparkleDownloadProgress(Sparkle sparkle, NetSparkleAppCastItem item, Image appIcon, Icon windowIcon, Boolean Unattend)
        {
            InitializeComponent();

            if (appIcon != null)
                imgAppIcon.Image = appIcon;

            if (windowIcon != null)
                Icon = windowIcon;

            // store the item
            _sparkle = sparkle;
            _item = item;
            //_referencedAssembly = referencedAssembly;
            _unattend = Unattend;

            // init ui
            btnInstallAndReLaunch.Visible = false;
            lblHeader.Text = lblHeader.Text.Replace("APP", item.AppName + " " + item.Version);
            progressDownload.Maximum = 100;
            progressDownload.Minimum = 0;
            progressDownload.Step = 1;

            // show the right 
            Size = new Size(Size.Width, 107);
            lblSecurityHint.Visible = false;
        }
		public void SetUpFixture()
		{
			resourceWriter = new MockResourceWriter();
			componentCreator = new MockComponentCreator();
			componentCreator.SetResourceWriter(resourceWriter);
			
			using (DesignSurface designSurface = new DesignSurface(typeof(Form))) {
				IDesignerHost host = (IDesignerHost)designSurface.GetService(typeof(IDesignerHost));
				IEventBindingService eventBindingService = new MockEventBindingService(host);
				host.AddService(typeof(IResourceService), componentCreator);
				
				Form form = (Form)host.RootComponent;
				form.ClientSize = new Size(200, 300);

				PropertyDescriptorCollection descriptors = TypeDescriptor.GetProperties(form);
				PropertyDescriptor namePropertyDescriptor = descriptors.Find("Name", false);
				namePropertyDescriptor.SetValue(form, "MainForm");
				
				// Add ImageList.
				icon = new Icon(typeof(GenerateFormResourceTestFixture), "App.ico");
				ImageList imageList = (ImageList)host.CreateComponent(typeof(ImageList), "imageList1");
				imageList.Images.Add("App.ico", icon);
				imageList.Images.Add("", icon);
				imageList.Images.Add("", icon);
				
				DesignerSerializationManager serializationManager = new DesignerSerializationManager(host);
				using (serializationManager.CreateSession()) {
					RubyCodeDomSerializer serializer = new RubyCodeDomSerializer("    ");
					generatedRubyCode = serializer.GenerateInitializeComponentMethodBody(host, serializationManager, "RootNamespace", 1);
				}
			}
		}
예제 #17
0
        public AboutBSM(Icon icon, Assembly a)
        {
            InitializeComponent();

            if (icon != null) this.Icon = icon;

            if (a != null) {
                software_title.Text = ((AssemblyTitleAttribute)a.GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0]).Title;
                version.Text = a.GetName().Version.ToString();
                copyright.Text = ((AssemblyCopyrightAttribute)a.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0]).Copyright;

                Assembly b = Assembly.GetAssembly(this.GetType());
                library_title.Text = ((AssemblyTitleAttribute)b.GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0]).Title;
                library_version.Text = b.GetName().Version.ToString();
                library_copyright.Text = ((AssemblyCopyrightAttribute)b.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0]).Copyright;

                Assembly dll = Assembly.GetAssembly(typeof(BrawlLib.StringTable));
                brawllib.Text = "Using " +
                    ((AssemblyTitleAttribute)dll.GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0]).Title + "\r\n" +
                    ((AssemblyCopyrightAttribute)dll.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0]).Copyright;

                textBox1.Text = "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\r\n" +
                "\r\n" +
                "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r\n" +
                "\r\n" +
                "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.";
            }
        }
        void CreateButtonDefinition()
        {
            System.Reflection.Assembly currentAssembly = System.Reflection.Assembly
                .GetExecutingAssembly();
            System.IO.Stream centerPtRectangleButtonPath = currentAssembly
                .GetManifestResourceStream
                ("QubeItTools.Resources.Vertical Mid Point Rectangle.ico");

            int largeIconSize = 32;
            int standardIconSize = 16;

            Icon VerticalMidPointRectangleIcon = new Icon(centerPtRectangleButtonPath);
            Icon largeVerticalMidPointRectangleIcon = new Icon(VerticalMidPointRectangleIcon, largeIconSize,
                largeIconSize);
            Icon standardVerticalMidPointRectangleIcon = new Icon(VerticalMidPointRectangleIcon,
                standardIconSize, standardIconSize);

            stdole.IPictureDisp largeIconPictureDisp =
                    (stdole.IPictureDisp)Support.IconToIPicture(largeVerticalMidPointRectangleIcon);
            stdole.IPictureDisp standardIconPictureDisp =
                (stdole.IPictureDisp)Support.IconToIPicture(standardVerticalMidPointRectangleIcon);

            ButtonDefinition = StandardAddInServer.InventorApplication.CommandManager.ControlDefinitions.
                    AddButtonDefinition("V.M.P.R.", ClientButtonInternalName,
                    CommandTypesEnum.kShapeEditCmdType, StandardAddInServer.AddInServerId,
                    "Create Vertical Mid Point Rectangle",
                    "Creates a rectangle that is constrained to the mid-point of one of the vertical lines",
                    standardIconPictureDisp, largeIconPictureDisp,
                    ButtonDisplayEnum.kDisplayTextInLearningMode);

            ButtonDefinition.Enabled = true;
            buttonPressed = ButtonDefinition.Pressed;
            CommandIsRunning = false;
        }
예제 #19
0
        /// <summary>
        /// Initializes an instance of this class
        /// </summary>
        /// <param name="icon">The icon to use for this button</param>
        /// <param name="tooltip">The tooltip string to use for this button.</param>
        public ThumbnailToolBarButton(Icon icon, string tooltip)
        {
            // Start internal update (so we don't accidently update the taskbar
            // via the native API)
            internalUpdate = true;

            // Set our id
            Id = nextId;

            // increment the ID
            if (nextId == Int32.MaxValue)
                nextId = 101; // our starting point
            else
                nextId++;

            // Set user settings
            Icon = icon;
            Tooltip = tooltip;

            // Defaults
            Enabled = true;

            // Create a native
            win32ThumbButton = new ThumbButton();

            // End our internal update
            internalUpdate = false;
        }
예제 #20
0
        public static void GetIconAndToolTip(ScheduleType scheduleType, UpcomingCancellationReason cancellationReason,
            bool isPartOfSeries, UpcomingOrActiveProgramsList upcomingRecordings, UpcomingRecording upcomingRecording,
            out Icon icon, out string toolTip)
        {
            toolTip = null;
            bool isCancelled = (cancellationReason != UpcomingCancellationReason.None);
            switch (scheduleType)
            {
                case ScheduleType.Recording:
                    GetRecordingIconAndToolTip(upcomingRecordings, cancellationReason, isPartOfSeries, upcomingRecording,
                        out icon, out toolTip);
                    break;

                case ScheduleType.Alert:
                    icon = isCancelled ? (isPartOfSeries ? Properties.Resources.AlertSeriesCancelledIcon : Properties.Resources.AlertCancelledIcon)
                        : GetIcon(ScheduleType.Alert, isPartOfSeries);
                    break;

                case ScheduleType.Suggestion:
                    icon = isCancelled ? (isPartOfSeries ? Properties.Resources.SuggestionSeriesCancelledIcon : Properties.Resources.SuggestionCancelledIcon)
                        : GetIcon(ScheduleType.Suggestion, isPartOfSeries);
                    break;

                default:
                    icon = Properties.Resources.TransparentIcon;
                    break;
            }
        }
예제 #21
0
파일: Content.cs 프로젝트: uvbs/Holodeck
        public Content(XmlTextReader xmlIn, int formatVersion)
        {
            // Define the initial object state
            _control = null;
            _title = "";
            _fullTitle = "";
            _imageList = null;
            _icon = null;
            _imageIndex = -1;
            _manager = null;
            _parentWindowContent = null;
            _displaySize = new Size(_defaultDisplaySize, _defaultDisplaySize);
            _autoHideSize = new Size(_defaultAutoHideSize, _defaultAutoHideSize);
            _floatingSize = new Size(_defaultFloatingSize, _defaultFloatingSize);
            _displayLocation = new Point(_defaultLocation, _defaultLocation);
            _order = _counter++;
            _tag = null;
            _visible = false;
            _defaultRestore = null;
            _autoHideRestore = null;
            _floatingRestore = null;
            _dockingRestore = null;
            _autoHidePanel = null;
            _docked = true;
            _captionBar = true;
            _closeButton = true;
            _hideButton = true;
            _autoHidden = false;
            _closeOnHide = false;

            // Overwrite default with values read in
            LoadFromXml(xmlIn, formatVersion);
        }
예제 #22
0
파일: Server.cs 프로젝트: dada/theresa
        public Server()
        {
            _Midi = new MidiOut();

              Assembly me = Assembly.GetExecutingAssembly();
              _IconNormal = new Icon(me.GetManifestResourceStream("TheresaServer.Theresa.ico"));
              _IconOn = new Icon(me.GetManifestResourceStream("TheresaServer.TheresaOn.ico"));
              _IconOff = new Icon(me.GetManifestResourceStream("TheresaServer.TheresaOff.ico"));

              _Tray = new NotifyIcon();
              _Tray.Icon = _IconNormal;
              _Tray.Text = "Theresa v0.6.1";
              _Tray.Visible = true;

              ContextMenu popup = new ContextMenu();
              MenuItem quit = new MenuItem();
              quit.Text = "Quit";
              quit.Click += new EventHandler(OnQuit);
              popup.MenuItems.Add(quit);
              _Tray.ContextMenu = popup;

              _ServerThread = new Thread(new ThreadStart(StartServer));
              Console.WriteLine("Starting server...");
              _ServerThread.Start();
              this.Load += new EventHandler(OnLoad);
              this.VisibleChanged +=new EventHandler(OnShow);
        }
예제 #23
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="item"></param>
        /// <param name="appIcon"></param>
        /// <param name="windowIcon"></param>
        public NetSparkleForm(NetSparkleAppCastItem item, Image appIcon, Icon windowIcon)
        {            
            InitializeComponent();
            
            // init ui 
            try
            {
                NetSparkleBrowser.AllowWebBrowserDrop = false;
                NetSparkleBrowser.AllowNavigation = false;
            }
            catch (Exception)
            { }
            
            _currentItem = item;

            lblHeader.Text = lblHeader.Text.Replace("APP", item.AppName);
            lblInfoText.Text = lblInfoText.Text.Replace("APP", item.AppName + " " + item.Version);
            lblInfoText.Text = lblInfoText.Text.Replace("OLDVERSION", item.AppVersionInstalled);

            if (!string.IsNullOrEmpty(item.ReleaseNotesLink) )
                NetSparkleBrowser.Navigate(item.ReleaseNotesLink);
            else            
                RemoveReleaseNotesControls();            

            if (appIcon != null)
                imgAppIcon.Image = appIcon;

            if (windowIcon != null)
                Icon = windowIcon;

            this.TopMost = true;
        }
예제 #24
0
파일: HotKeys.cs 프로젝트: burstas/rmps
        public HotKeys(Icon icon, DataTable dataTable)
        {
            InitializeComponent();

            this.Icon = icon;
            DvKeys.DataSource = dataTable;
        }
예제 #25
0
파일: App.cs 프로젝트: bberak/Appy
        void LoadIcon()
        {
            string iconFile = "App.ico";

            if (Files.Exists(iconFile))
                Icon = new Icon(iconFile);
        }
		private static BitmapFrame ConvertFromIcon(Icon icon)
		{
			var memoryStream = new MemoryStream();
			icon.Save(memoryStream);
			memoryStream.Seek(0, SeekOrigin.Begin);
			return BitmapFrame.Create(memoryStream);
		}  
		public void SetUpFixture()
		{
			resourceWriter = new MockResourceWriter();
			componentCreator = new MockComponentCreator();
			componentCreator.SetResourceWriter(resourceWriter);
			
			using (DesignSurface designSurface = new DesignSurface(typeof(Form))) {
				IDesignerHost host = (IDesignerHost)designSurface.GetService(typeof(IDesignerHost));
				IEventBindingService eventBindingService = new MockEventBindingService(host);
				host.AddService(typeof(IResourceService), componentCreator);
				
				Form form = (Form)host.RootComponent;
				form.ClientSize = new Size(200, 300);

				PropertyDescriptorCollection descriptors = TypeDescriptor.GetProperties(form);
				PropertyDescriptor namePropertyDescriptor = descriptors.Find("Name", false);
				namePropertyDescriptor.SetValue(form, "MainForm");
				
				// Set bitmap as form background image.
				bitmap = new Bitmap(10, 10);
				form.BackgroundImage = bitmap;
				
				icon = new Icon(typeof(GenerateFormResourceTestFixture), "App.ico");
				form.Icon = icon;
				
				DesignerSerializationManager serializationManager = new DesignerSerializationManager(host);
				using (serializationManager.CreateSession()) {					
					PythonCodeDomSerializer serializer = new PythonCodeDomSerializer("    ");
					generatedPythonCode = serializer.GenerateInitializeComponentMethodBody(host, serializationManager, "RootNamespace", 1);
				}
			}
		}
예제 #28
0
        public Button(string displayName, string internalName, CommandTypesEnum commandType, string clientId, string description, string tooltip, Icon standardIcon, Icon largeIcon, ButtonDisplayEnum buttonDisplayType)
        {
            try
            {
                //get IPictureDisp for icons
                stdole.IPictureDisp standardIconIPictureDisp;
                standardIconIPictureDisp = (stdole.IPictureDisp)Support.IconToIPicture(standardIcon);

                stdole.IPictureDisp largeIconIPictureDisp;
                largeIconIPictureDisp = (stdole.IPictureDisp)Support.IconToIPicture(largeIcon);

                //create button definition
                m_buttonDefinition = m_inventorApplication.CommandManager.ControlDefinitions.AddButtonDefinition(displayName, internalName, commandType, clientId, description, tooltip, standardIconIPictureDisp , largeIconIPictureDisp, buttonDisplayType);

                //enable the button
                m_buttonDefinition.Enabled = true;

                //connect the button event sink
                ButtonDefinition_OnExecuteEventDelegate = new ButtonDefinitionSink_OnExecuteEventHandler(ButtonDefinition_OnExecute);
                m_buttonDefinition.OnExecute += ButtonDefinition_OnExecuteEventDelegate;
            }
            catch(Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }
예제 #29
0
        /// <summary>
        /// Constructor; loads the history data and gets the icons for each protocol.
        /// </summary>
        /// <param name="applicationForm">Main application for for this window.</param>
        public HistoryWindow(MainForm applicationForm)
        {
            _applicationForm = applicationForm;

            InitializeComponent();

            _historyListView.ListViewItemSorter = new HistoryComparer(_connections);

            // Get the icon for each protocol
            foreach (IProtocol protocol in ConnectionFactory.GetProtocols())
            {
                Icon icon = new Icon(protocol.ProtocolIcon, 16, 16);

                historyImageList.Images.Add(icon);
                _connectionTypeIcons[protocol.ConnectionType] = historyImageList.Images.Count - 1;
            }

            // Load the history data
            if (File.Exists(_historyFileName))
            {
                XmlSerializer historySerializer = new XmlSerializer(typeof (List<HistoricalConnection>));
                List<HistoricalConnection> historicalConnections = null;

                using (XmlReader historyReader = new XmlTextReader(_historyFileName))
                    historicalConnections = (List<HistoricalConnection>) historySerializer.Deserialize(historyReader);

                foreach (HistoricalConnection historyEntry in historicalConnections)
                    AddToHistory(historyEntry);
            }
        }
예제 #30
0
 /// Methods
 static DomIcon()
 {
     DomIcon.DomIcons = new Hashtable(0x10);
       DomIcon.Images = new ImageList();
       DomIcon.PropertyDocument = new XmlDocument();
       DomIcon.Images = ResourceHelper.LoadBitmapStrip(Type.GetType("ItopVector.Resource.DomIcon"), "ItopVector.Resource.DomIcon.Bitmap1.bmp", new Size(0x10, 0x10), new Point(0, 0));
       Assembly assembly1 = Assembly.GetAssembly(Type.GetType("ItopVector.Resource.DomIcon"));
       string[] textArray1 = assembly1.GetManifestResourceNames();
       string text1 = "ItopVector.Resource.DomIcon.";
       string[] textArray2 = textArray1;
       for (int num1 = 0; num1 < textArray2.Length; num1++)
       {
       string text2 = textArray2[num1];
       if (text2.EndsWith(".ico") && (text2.IndexOf(text1) >= 0))
       {
           Stream stream1 = assembly1.GetManifestResourceStream(text2);
           string text3 = text2.Substring(text1.Length, text2.Length - text1.Length);
           text3 = text3.Substring(0, text3.Length - 4);
           if (stream1 != null)
           {
               Icon icon1 = new Icon(stream1);
               DomIcon.DomIcons.Add(text3, icon1);
           }
       }
       }
       assembly1 = Assembly.GetAssembly(Type.GetType("ItopVector.Resource.DomIcon"));
       Stream stream2 = assembly1.GetManifestResourceStream("ItopVector.Resource.DomIcon.domimage.xml");
       if (stream2 != null)
       {
       DomIcon.PropertyDocument.Load(stream2);
       }
 }
예제 #31
0
    private void Form_Load(object sender, EventArgs e)
    {
        var appIcon  = ConfigurationManager.AppSettings["AppIcon"] ?? "icon.ico";
        var iconPath = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, appIcon));

        if (File.Exists(iconPath))
        {
            var icon = new System.Drawing.Icon(iconPath);
            this.Icon            = icon;
            this.NotifyIcon.Icon = icon;
        }
        var appName = ConfigurationManager.AppSettings["AppName"];

        if (!string.IsNullOrEmpty(appName))
        {
            this.Text            = appName;
            this.NotifyIcon.Text = appName;
        }

        this.Visible      = false;
        this.FormClosing += Form_FormClosing;
        this.LogShowing  += Form_LogShowing;

        Task.Run(() => HostManager.Start());
        foreach (var url in HostManager.GetUrls().Reverse())
        {
            var item = new ToolStripMenuItem
            {
                Name = url,
                Text = $"    {url}",
                Size = new System.Drawing.Size(322, 38),
                Tag  = url,
            };
            item.Click += ToolStripMenuItem_Open_Click;
            this.ContextMenuStrip_NotifyIcon.Items.Insert(1, item);
        }
    }
예제 #32
0
        private void frmPublicar_Load(object sender, EventArgs e)
        {
            this.CenterToScreen();
            System.Drawing.Icon ico = Properties.Resources.icono_app;
            lstSubcategorias4.Enabled                 = false;
            this.dgvDatos.AllowUserToAddRows          = false;
            this.dgvDatos.AllowUserToDeleteRows       = false;
            this.dgvDatos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dgvDatos.Location   = new System.Drawing.Point(258, 290);
            this.dgvDatos.Name       = "dgvDatos";
            this.dgvDatos.Size       = new System.Drawing.Size(895, 305);
            this.dgvDatos.TabIndex   = 21;
            this.dgvDatos.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(dgvDatos_CellClick);
            this.Controls.Add(this.dgvDatos);
            tblArticulos = BL.ArticulosBLL.GetArticulosStock();
            meli         = new MeliApiService();
            var results = from DataRow myRow in tblArticulos.Rows
                          where myRow.Field <decimal?>("Stock") != 0 && myRow.Field <decimal?>("Stock") != null
                          select myRow;

            tblStock = results.CopyToDataTable();
            tblStock.Columns.Add("Publicar", typeof(bool));
            bindingSource1.DataSource = tblStock;
            bindingSource1.Filter     = "IdArticuloART LIKE '000000000'";
            viewDatos                    = new DataView(tblStock);
            viewDatos.RowFilter          = "IdArticuloART LIKE '000000000'";
            dgvDatos.DataSource          = viewDatos;
            dgvDatos.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            dgvDatos.EditMode            = DataGridViewEditMode.EditOnKeystroke;
            dgvDatos.Columns["PrecioPublicoART"].Visible  = false;
            dgvDatos.Columns["PrecioMayorART"].Visible    = false;
            dgvDatos.Columns["PrecioCostoART"].HeaderText = "Costo";
            dgvDatos.Columns["PrecioCostoART"].ReadOnly   = true;
            dgvDatos.Columns["IdArticuloART"].HeaderText  = "Codigo";
            dgvDatos.Columns["IdArticuloART"].ReadOnly    = true;
            dgvDatos.Columns["DescripcionART"].HeaderText = "Descripcion";
            dgvDatos.Columns["DescripcionART"].ReadOnly   = true;

            imageColumn            = new DataGridViewImageColumn();
            imageColumn.Image      = emptyImage;
            imageColumn.Name       = "Image_1";
            imageColumn.HeaderText = "Imagen 1";
            dgvDatos.Columns.Add(imageColumn);

            imageColumn            = new DataGridViewImageColumn();
            imageColumn.Image      = emptyImage;
            imageColumn.Name       = "Image_2";
            imageColumn.HeaderText = "Imagen 2";
            imageColumn.Visible    = false;
            dgvDatos.Columns.Add(imageColumn);

            imageColumn            = new DataGridViewImageColumn();
            imageColumn.Image      = emptyImage;
            imageColumn.Name       = "Image_3";
            imageColumn.HeaderText = "Imagen 3";
            imageColumn.Visible    = false;
            dgvDatos.Columns.Add(imageColumn);

            imageColumn            = new DataGridViewImageColumn();
            imageColumn.Image      = emptyImage;
            imageColumn.Name       = "Image_4";
            imageColumn.HeaderText = "Imagen 4";
            imageColumn.Visible    = false;
            dgvDatos.Columns.Add(imageColumn);

            urlColumn         = new DataGridViewTextBoxColumn();
            urlColumn.Name    = "url_1";
            urlColumn.Visible = false;
            dgvDatos.Columns.Add(urlColumn);

            urlColumn         = new DataGridViewTextBoxColumn();
            urlColumn.Name    = "url_2";
            urlColumn.Visible = false;
            dgvDatos.Columns.Add(urlColumn);

            urlColumn         = new DataGridViewTextBoxColumn();
            urlColumn.Name    = "url_3";
            urlColumn.Visible = false;
            dgvDatos.Columns.Add(urlColumn);

            urlColumn         = new DataGridViewTextBoxColumn();
            urlColumn.Name    = "url_4";
            urlColumn.Visible = false;
            dgvDatos.Columns.Add(urlColumn);

            dgvDatos.RowTemplate.Height = 40;
            txtParametros.Focus();
        }
예제 #33
0
        async void UpdateIPSessions()
        {
            try
            {
                while (!cts.IsCancellationRequested)
                {
                    Kernel32.GetDeviceNameMap();
                    listView1.BeginUpdate();
                    sessions = Iphlpapi.GetIPSessions();
                    IPAddress ipAddress;
                    // add/update items
                    foreach (Iphlpapi.IPSession session in sessions)
                    {
                        // get process info
                        string filePath   = Psapi.GetProcessFileName(session.OwningPid);
                        int    imageIndex = 0;
                        if (processList.ContainsKey(session.OwningPid))
                        {
                            imageIndex = processList[session.OwningPid].ImageListIndex;
                        }
                        else if (processList.Where(i => i.Value.Path == filePath).Count() > 0)
                        {
                            OwningProcess owningProcess = processList.Where(i => i.Value.Path == filePath).First().Value;
                            processList.TryAdd(session.OwningPid, owningProcess);
                            imageIndex = owningProcess.ImageListIndex;
                        }
                        else
                        {
                            System.Drawing.Icon icon = null;
                            if (filePath != "")
                            {
                                icon = System.Drawing.Icon.ExtractAssociatedIcon(filePath);
                            }
                            if (icon != null)
                            {
                                imageList1.Images.Add(icon);
                                imageIndex = imageList1.Images.Count - 1;
                                OwningProcess owningProcess = new OwningProcess();
                                owningProcess.Path           = filePath;
                                owningProcess.ImageListIndex = imageIndex;
                                processList.TryAdd(session.OwningPid, owningProcess);
                            }
                        }
                        // add process in TV
                        if (!treeView1.Nodes[0].Nodes.ContainsKey(Path.GetFileName(filePath) + " (" + session.OwningPid + ")"))
                        {
                            treeView1.Nodes[0].Nodes.Add(Path.GetFileName(filePath) + " (" + session.OwningPid + ")",
                                                         Path.GetFileName(filePath) + " (" + session.OwningPid + ")", imageIndex, imageIndex).Parent.Expand();
                        }

                        // filter
                        if (session.SocketID.LocalEP.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork && comboBox1.SelectedIndex == 1 ||
                            session.SocketID.LocalEP.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6 && comboBox1.SelectedIndex == 0)
                        {
                            continue;
                        }
                        if (treeView1.SelectedNode != null &&
                            treeView1.SelectedNode.Parent != null)
                        {
                            if (session.OwningPid != uint.Parse(Regex.Replace(treeView1.SelectedNode.Text, @"^.*\((\d+)\)$", "$1")))
                            {
                                continue;
                            }
                        }
                        if (filterProtocol.SelectedIndex == 0 && session.SocketID.Protocol != IP.ProtocolFamily.TCP ||
                            filterProtocol.SelectedIndex == 1 && session.SocketID.Protocol != IP.ProtocolFamily.UDP)
                        {
                            continue;
                        }

                        // update existing items
                        bool found = false;
                        foreach (ListViewItem item in listView1.Items)
                        {
                            // find item
                            if (session.SocketID.Equals(item.Tag))
                            {
                                found = true;
                                item.SubItems[6].Text = session.State;
                                IPEndPoint remoteEP;
                                // resolve IP
                                if (resolveIP.Checked)
                                {
                                    if (((IP.SocketID)item.Tag).Protocol == IP.ProtocolFamily.UDP)
                                    {
                                        if ((remoteEP = UdpDetector.Table.GetRemoteEP(((IP.SocketID)item.Tag).LocalEP)) != null)
                                        {
                                            if (!DnsRescords.ContainsKey(remoteEP.Address))
                                            {
                                                ResolveIP(remoteEP.Address);
                                            }
                                            else if (DnsRescords[remoteEP.Address] != "")
                                            {
                                                item.SubItems[3].Text = DnsRescords[remoteEP.Address];
                                            }
                                        }
                                    }
                                    else if (((IP.SocketID)item.Tag).Protocol == IP.ProtocolFamily.TCP)
                                    {
                                        if (!DnsRescords.ContainsKey(((IP.SocketID)item.Tag).RemoteEP.Address))
                                        {
                                            ResolveIP(((IP.SocketID)item.Tag).RemoteEP.Address);
                                        }
                                        else if (DnsRescords[((IP.SocketID)item.Tag).RemoteEP.Address] != "")
                                        {
                                            item.SubItems[3].Text = DnsRescords[((IP.SocketID)item.Tag).RemoteEP.Address];
                                        }
                                    }
                                }
                                else
                                {
                                    if (!IPAddress.TryParse(item.SubItems[3].Text, out ipAddress))
                                    {
                                        item.SubItems[3].Text = ((IP.SocketID)item.Tag).RemoteEP.Address.ToString();
                                    }
                                }
                                // update remote UDP EP
                                if (((IP.SocketID)item.Tag).Protocol == IP.ProtocolFamily.UDP &&
                                    (item.SubItems[3].Text == "0.0.0.0" || item.SubItems[3].Text == "::" ||
                                     item.SubItems[4].Text == "0") &&
                                    (remoteEP = UdpDetector.Table.GetRemoteEP(((IP.SocketID)item.Tag).LocalEP)) != null)
                                {
                                    item.SubItems[3].Text = remoteEP.Address.ToString();
                                    item.SubItems[4].Text = remoteEP.Port.ToString();
                                }
                                // update bytes
                                if (getBytes.Checked == true)
                                {
                                    ByteCounter.ByteTable.Bytes bytes = ByteCounter.Table.GetBytes((IP.SocketID)item.Tag);
                                    if (bytes.Received > 0 || bytes.Sent > 0)
                                    {
                                        item.SubItems[7].Text = Unit.AutoScale(bytes.Received, "B");
                                        item.SubItems[8].Text = Unit.AutoScale(bytes.Sent, "B");
                                    }
                                    else
                                    {
                                        item.SubItems[7].Text = "";
                                        item.SubItems[8].Text = "";
                                    }
                                }
                            }
                        }

                        if (!found)
                        {
                            listView1.Items.Add(new ListViewItem(new string[] {
                                Path.GetFileName(filePath) + " (" + session.OwningPid + ")",
                                session.SocketID.LocalEP.Address.ToString(),
                                session.SocketID.LocalEP.Port.ToString(),
                                session.SocketID.RemoteEP.Address.ToString(),
                                session.SocketID.RemoteEP.Port.ToString(),
                                session.SocketID.Protocol.ToString(),
                                session.State,
                                "", ""
                            }, imageIndex)).Tag = session.SocketID;
                        }
                    }
                    // delete items
                    foreach (ListViewItem item in listView1.Items)
                    {
                        if (!sessions.Any((i) => i.SocketID.Equals(item.Tag)) ||
                            item.SubItems[1].Text.Contains(':') && comboBox1.SelectedIndex == 0 ||
                            !item.SubItems[1].Text.Contains(':') && comboBox1.SelectedIndex == 1 ||
                            filterProtocol.SelectedIndex == 0 && item.SubItems[5].Text != "TCP" ||
                            filterProtocol.SelectedIndex == 1 && item.SubItems[5].Text != "UDP")
                        {
                            item.Remove();
                        }
                        else if (treeView1.SelectedNode != null &&
                                 treeView1.SelectedNode.Parent != null)
                        {
                            if (item.SubItems[0].Text != treeView1.SelectedNode.Text)
                            {
                                item.Remove();
                            }
                        }
                    }

                    foreach (KeyValuePair <uint, OwningProcess> process in processList)
                    {
                        if (sessions.Find(i => i.OwningPid == process.Key) == null)
                        {
                            treeView1.Nodes[0].Nodes.RemoveByKey(Path.GetFileName(process.Value.Path) + " (" + process.Key + ")");
                            OwningProcess value;
                            processList.TryRemove(process.Key, out value);
                        }
                    }

                    foreach (ColumnHeader column in listView1.Columns)
                    {
                        column.Width = -2;
                    }
                    listView1.Sort();
                    listView1.EndUpdate();
                    //Unit.Compare("10.5 KB", "10.5 B");
                    await TaskEx.Delay(1000);
                }
            }
            catch (Exception e) { Global.WriteLog(e.ToString()); }
        }
예제 #34
0
        public Form1()
        {
            InitializeComponent();

            this.panel3.Padding = new Padding(50, 20, 50, 1);
            this.superAccelerator1.SetAccelerator(this.toolStripTabItem2, "R");
            this.gradientPanel1.Visible               = false;
            this.richTextBox1.Visible                 = false;
            this.gridControl1.Visible                 = false;
            this.ribbonControlAdv1.SelectedTab        = toolStripTabItem6;
            this.ribbonControlAdv1.ShowMinimizeButton = true;
            this.statusStripEx1.ContextMenuStrip      = null;
            this.toolStripPanelItem24.BackColor       = Color.FromArgb(205, 230, 247);
            this.toolStripButton35.BackColor          = Color.FromArgb(205, 230, 247);

            // To host any .Net control into ToolStripEx, StatusStrip,
            // User can make use of ToolStripControlHost class
            // and host the control inside it and add the host
            // to item collection.
            this.treeViewAdv1.Style = TreeStyle.Metro;
            ToolStripControlHost host1 = new ToolStripControlHost(this.treeViewAdv1);

            this.toolStripEx25.Items.Add(host1);
            GridMetroColors theme = new GridMetroColors();

            theme.HeaderBottomBorderWeight        = GridBottomBorderWeight.Thick;
            theme.HeaderBottomBorderColor         = ColorTranslator.FromHtml("#217346");
            theme.HeaderColor.HoverColor          = ColorTranslator.FromHtml("#9fd5b7");
            theme.HeaderTextColor.NormalTextColor = Color.Black;
            this.gridControl1.SetMetroStyle(theme);
            ToolStripControlHost host2 = new ToolStripControlHost(this.gridControl1);

            this.toolStripEx26.Items.Add(host2);
            ToolStripControlHost host3 = new ToolStripControlHost(this.panel1);

            this.panel1.Visible = false;
            this.toolStripSplitButton1.DropDown = new CustomDropdown(this.colorPickerUIAdv1);
            try
            {
                System.Drawing.Icon ico = new System.Drawing.Icon(GetIconFile(@"common\Images\Grid\Icon\sfgrid.ico"));
                this.Icon = ico;
            }
            catch { }


            foreach (ToolStripTabItem items in this.ribbonControlAdv1.Header.MainItems)
            {
                foreach (ToolStripEx item in items.Panel.Controls)
                {
                    item.LauncherClick += new EventHandler(item_LauncherClick);
                }
            }

            this.ribbonControlAdv1.QuickPanelVisible = true;
            this.HelpButton = false;
            this.ribbonControlAdv1.ShowRibbonDisplayOptionButton = false;
            this.WindowState = FormWindowState.Maximized;

            string path = Application.StartupPath.ToString() + @"..\..\..\Introduction.rtf";

            if (File.Exists(path))
            {
                this.richTextBox2.LoadFile(path, RichTextBoxStreamType.RichText);
            }

            foreach (ToolStripTabItem item in this.ribbonControlAdv1.Header.MainItems)
            {
                foreach (ToolStripEx toolstripex in item.Panel.Controls)
                {
                    toolstripex.AutoSize = true;
                    if (toolstripex.Text == "Labels")
                    {
                        toolstripex.Padding = new Padding(10, 0, 0, 0);
                    }
                }
            }
        }
예제 #35
0
        private System.Windows.Media.ImageSource ConvertIconToImageSource(VistaTaskDialogIcon icon, bool isLarge)
        {
            System.Windows.Media.ImageSource iconSource = null;
            System.Drawing.Icon   sysIcon = null;
            System.Drawing.Bitmap altBmp  = null;

            try
            {
                switch (icon)
                {
                default:
                case VistaTaskDialogIcon.None:
                    break;

                case VistaTaskDialogIcon.Information:
                    sysIcon = System.Drawing.SystemIcons.Information;
                    break;

                case VistaTaskDialogIcon.Warning:
                    sysIcon = System.Drawing.SystemIcons.Warning;
                    break;

                case VistaTaskDialogIcon.Error:
                    sysIcon = System.Drawing.SystemIcons.Error;
                    break;

                case VistaTaskDialogIcon.Shield:
                    if (isLarge)
                    {
                        altBmp = new Bitmap(AssemblyHelper.GetEmbeddedResource("IExtendFramework.Controls.AdvancedMessageBox.Resources.shield-32.png"));
                    }
                    else
                    {
                        altBmp = new Bitmap(AssemblyHelper.GetEmbeddedResource("IExtendFramework.Controls.AdvancedMessageBox.Resources.shield-16.png"));
                    }
                    break;
                }

                if (sysIcon != null)
                {
                    iconSource = System.Windows.Interop.Imaging.CreateBitmapSourceFromHIcon(
                        sysIcon.Handle,
                        System.Windows.Int32Rect.Empty,
                        System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
                }
                else if (altBmp != null)
                {
                    iconSource = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
                        altBmp.GetHbitmap(),
                        IntPtr.Zero,
                        System.Windows.Int32Rect.Empty,
                        System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
                }
            }
            finally
            {
                if (sysIcon != null)
                {
                    sysIcon.Dispose();
                }
                if (altBmp != null)
                {
                    altBmp.Dispose();
                }
            }

            return(iconSource);
        }
예제 #36
0
 public Details(System.Drawing.Icon Icon, string MainMessage, string WindowTitle) : this(Icon, MainMessage)
 {
     this.WindowTitle = WindowTitle;
 }
예제 #37
0
 public Details(System.Drawing.Icon Icon, string MainMessage)
 {
     this.MainMessage = "";
     this.Icon        = Icon;
     this.MainMessage = MainMessage;
 }
예제 #38
0
 public static Icon ToEto(this sd.Icon icon)
 {
     return(new Icon(new IconHandler(icon)));
 }
예제 #39
0
    /// <summary>
    /// Initialize the elements of the Interface.
    /// </summary>
    /// <param name="gameInfo"><see cref="Classes.GameInfo"/></param>
    /// <param name="isFromEdit"><see cref="true"/> if is called from the <see cref="EditGame"/> window.</param>
    internal void InitializeUI(GameInfo gameInfo, GavilyaPages gavilyaPages, bool isFromEdit = false, bool recommanded = false)
    {
        // Tooltip
        PlayToolTip.Content     = Properties.Resources.PlayLowerCase + " " + Properties.Resources.PlayTo + gameInfo.Name;
        GameToolTipName.Content = gameInfo.Name;

        // Border
        GameCardBorder.BorderThickness = new(0);                                                                                                                                                // Set the border thickness
        GameCardBorder.BorderBrush     = GameInfo.IsFavorite ? new SolidColorBrush(Color.FromRgb(55, 121, 238)) : GameCardBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(102, 0, 255)); // Set the border color


        // Location
        location = gameInfo.FileLocation;

        // Icon
        try
        {
            if (gameInfo.IconFileLocation != string.Empty && gameInfo.IconFileLocation != null)             // If a custom image is used
            {
                var bitmap = new BitmapImage();
                var stream = File.OpenRead(gameInfo.IconFileLocation);

                bitmap.BeginInit();
                bitmap.CacheOption      = BitmapCacheOption.OnLoad;
                bitmap.StreamSource     = stream;
                bitmap.DecodePixelWidth = 256;
                bitmap.EndInit();
                stream.Close();
                stream.Dispose();
                bitmap.Freeze();
                GameIcon.ImageSource = bitmap;
            }
            else
            {
                if (!gameInfo.IsUWP && !gameInfo.IsSteam)                 // If the game isn't UWP
                {
                    System.Drawing.Icon icon = System.Drawing.Icon.ExtractAssociatedIcon(gameInfo.FileLocation);
                    GameIcon.ImageSource = System.Windows.Interop.Imaging.CreateBitmapSourceFromHIcon(icon.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());                     // Show the image
                }
            }
        }
        catch
        {
            GameIcon.ImageSource = new BitmapImage(new Uri("pack://application:,,,/Gavilya;component/Assets/PC.png"));             // Show the default image
        }

        // Favorite
        if (gameInfo.IsFavorite && !isFromEdit)         // If the game is a favorite
        {
            FavoriteGameCard = new FavoriteGameCard(gameInfo, this);
            Definitions.HomePage.FavoriteBar.Children.Add(FavoriteGameCard); // Add the game to the favorite bar
            FavBtn.Content = "\uF71B";                                       // Change icon
        }

        if (recommanded)
        {
            Definitions.HomePage.RecommandedBar.Children.Add(new FavoriteGameCard(gameInfo, this));             // Add the game to the recommanded bar
        }

        // Checkbox visibility
        if (Definitions.IsGamesCardsPagesCheckBoxesVisible)       // If the checkboxes are visibles
        {
            CheckBox.Visibility = Visibility.Visible;             // Visible
        }
        else
        {
            CheckBox.Visibility = Visibility.Hidden;             // Hiddent
        }

        // Page
        switch (gavilyaPages)
        {
        case GavilyaPages.Recent:                       // If the page is recent
            FavBtn.Visibility   = Visibility.Collapsed; // Hide the favorite button
            CheckBox.Visibility = Visibility.Hidden;    // Hide the checkbox
            MenuGroup.SetValue(Grid.ColumnProperty, 3);
            break;

        case GavilyaPages.Cards:                    // If the page is card
            FavBtn.Visibility = Visibility.Visible; // Show the favorite button
            break;
        }
    }
예제 #40
0
 public Form1()
 {
     InitializeComponent();
     try
     {
         System.Drawing.Icon ico = new System.Drawing.Icon(GetIconFile(@"common\Images\Grid\Icon\sfgrid.ico"));
         this.Icon = ico;
     }
     catch { }
     this.radialGauge1.Ranges.Clear();
     timer          = new Timer();
     timer.Interval = 1;
     timer.Tick    += new EventHandler(timer_Tick);
     timer.Start();
     range1.Color          = System.Drawing.ColorTranslator.FromHtml("#0CBDF4");
     range1.EndValue       = 120F;
     range1.Height         = 70;
     range1.InRange        = false;
     range1.Name           = "Normal range";
     range1.RangePlacement = Syncfusion.Windows.Forms.Gauge.TickPlacement.OutSide;
     range1.StartValue     = 0F;
     range2.Color          = System.Drawing.ColorTranslator.FromHtml("#E8E8E8");
     range2.EndValue       = 120F;
     range2.Height         = 70;
     range2.InRange        = false;
     range2.Name           = "Normal range";
     range2.RangePlacement = Syncfusion.Windows.Forms.Gauge.TickPlacement.OutSide;
     range2.StartValue     = 0F;
     this.radialGauge1.Ranges.Add(range1);
     this.radialGauge1.Ranges.Add(range2);
     this.trackBar1.ValueChanged    += new EventHandler(trackBar1_ValueChanged);
     this.radialGauge1.ValueChanged += new EventHandler(radialGauge1_ValueChanged);
     using (Graphics g = this.CreateGraphics())
     {
         if (g.DpiX > 96)
         {
             this.label1.Location       = new System.Drawing.Point(191, 323);
             this.label1.Size           = new System.Drawing.Size(39, 25);
             this.label2.Location       = new System.Drawing.Point(591, 323);
             this.label2.Size           = new System.Drawing.Size(59, 25);
             this.panel2.Location       = new System.Drawing.Point(35, 265);
             this.panel2.Margin         = new System.Windows.Forms.Padding(4);
             this.panel2.Size           = new System.Drawing.Size(136, 12);
             this.panel3.Location       = new System.Drawing.Point(436, 264);
             this.panel3.Margin         = new System.Windows.Forms.Padding(4);
             this.panel3.Size           = new System.Drawing.Size(136, 12);
             this.label3.Location       = new System.Drawing.Point(372, 271);
             this.label3.Size           = new System.Drawing.Size(82, 28);
             this.label4.Location       = new System.Drawing.Point(336, 222);
             this.label4.Size           = new System.Drawing.Size(149, 46);
             this.MetroColor            = System.Drawing.SystemColors.ButtonHighlight;
             this.radialGauge1.Location = new System.Drawing.Point(35, 4);
             this.radialGauge1.Margin   = new System.Windows.Forms.Padding(4);
             this.radialGauge1.Size     = new System.Drawing.Size(537, 358);
             this.panel1.Location       = new System.Drawing.Point(103, 52);
             this.panel1.Size           = new System.Drawing.Size(624, 369);
             this.AutoScaleDimensions   = new System.Drawing.SizeF(8F, 16F);
         }
         else
         {
             this.label1.Location = new System.Drawing.Point(143, 246);
             this.label2.Location = new System.Drawing.Point(449, 247);
             this.panel2.Location = new System.Drawing.Point(25, 198);
             this.panel3.Location = new System.Drawing.Point(338, 198);
         }
     }
     this.radialGauge1.MinorInnerLinesHeight = 0;
 }
예제 #41
0
 public static stdole.IPictureDisp ToIPictureDisp(System.Drawing.Icon icon)
 {
     PICTDESC.Icon pictIcon = new PICTDESC.Icon(icon);
     return(OleCreatePictureIndirect(pictIcon, ref iPictureDispGuid, true));
 }
예제 #42
0
 private void RegisterPage_Load(object sender, EventArgs e)
 {
     System.Drawing.Icon ico = new System.Drawing.Icon("Assets/netflix.ico");
     this.Icon = ico;
 }
예제 #43
0
        public Dictionary <string, string[]> GetIconsAndPaths()
        {
            string        path             = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu) + "\\Programs";
            DirectoryInfo startMenuProgDir = new DirectoryInfo(path);

            if ((startMenuProgDir.Exists != true))
            {
                string dirPath = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) + "\\Programs";
                startMenuProgDir = new DirectoryInfo(dirPath);
            }
            WshShell shell = new WshShell();

            CreateIconsDirectory();

            foreach (FileInfo fi in startMenuProgDir.GetFiles())
            {
                if ((fi.Extension == ".lnk"))
                {
                    // The length of the file's name alone minus .lnk
                    int nameLength = fi.Name.Length - 4;
                    // Name to display in UserControl
                    string displayName = fi.Name.Substring(0, nameLength);
                    // Copy of shortcut
                    IWshShortcut link = (IWshShortcut)shell.CreateShortcut(fi.FullName);

                    string   potentialExePath = link.TargetPath;
                    FileInfo potentialExe     = new FileInfo(potentialExePath);

                    if ((potentialExe.Extension == ".exe"))
                    {
                        string tileIconPath = Environment.CurrentDirectory + "\\WPF Metro Icons\\" + displayName + ".png";
                        try
                        {
                            System.Drawing.Icon ico = System.Drawing.Icon.ExtractAssociatedIcon(potentialExePath);
                            ico.ToBitmap().Save(tileIconPath, System.Drawing.Imaging.ImageFormat.Png);

                            AddToDictionary(displayName, tileIconPath, potentialExePath);
                        }
                        catch (FileNotFoundException ex)
                        {
                            break; // TODO: might not be correct. Was : Exit Try
                        }
                    }
                }
            }

            // Get icons for .lnk in ...Start Menu\Programs\...
            foreach (DirectoryInfo di in startMenuProgDir.GetDirectories())
            {
                foreach (FileInfo fi in di.GetFiles())
                {
                    if ((fi.Extension == ".lnk"))
                    {
                        // The length of the file's name alone minus .lnk
                        int nameLength = fi.Name.Length - 4;
                        // Name to display in UserControl
                        string displayName = fi.Name.Substring(0, nameLength);
                        // Avoid install and uninstall files
                        if ((displayName.Contains("install") != true))
                        {
                            IWshShortcut link             = (IWshShortcut)shell.CreateShortcut(fi.FullName);
                            string       potentialExePath = link.TargetPath;

                            if ((potentialExePath.Contains(".exe")))
                            {
                                string tileIconPath = Environment.CurrentDirectory + "\\WPF Metro Icons\\" + displayName + ".png";
                                try
                                {
                                    Icon ico = Icon.ExtractAssociatedIcon(potentialExePath);
                                    ico.ToBitmap().Save(tileIconPath, System.Drawing.Imaging.ImageFormat.Png);

                                    CheckMSOfficeApps(displayName, tileIconPath);

                                    AddToDictionary(displayName, tileIconPath, potentialExePath);
                                }
                                catch (FileNotFoundException ex)
                                {
                                    break; // TODO: might not be correct. Was : Exit Try
                                }
                                catch (ArgumentException ex)
                                {
                                    break; // TODO: might not be correct. Was : Exit Try
                                }
                            }
                        }
                    }
                }
            }

            return(IconsPathsDi);
        }
예제 #44
0
 public Icon(Icon original, Size size) : this(original, size.Width, size.Height)
 {
 }
        public int GetIconIndex(string filename)
        {
            int    retval = -1;
            string ext    = Path.GetExtension(filename);

            if (ext.Equals(".exe", StringComparison.CurrentCultureIgnoreCase) || ext.Equals(".lnk", StringComparison.CurrentCultureIgnoreCase))
            {
                SHFILEINFO shinfo = new SHFILEINFO();
                /*IntPtr hImgSmall =*/ shell32.SHGetFileInfo(filename, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), shell32.SHGFI_ICON | shell32.SHGFI_SMALLICON);
                System.Drawing.Icon tmp = System.Drawing.Icon.FromHandle(shinfo.hIcon);
                _smallImageList.Images.Add(tmp);
                shell32.SHGetFileInfo(filename, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), shell32.SHGFI_ICON | shell32.SHGFI_LARGEICON);
                tmp = System.Drawing.Icon.FromHandle(shinfo.hIcon);
                _largeImageList.Images.Add(tmp);

                retval = _smallImageList.Images.Count - 1;
                _fileTypeIndecies.Add(filename, retval);
            }
            else if (ext.Equals(".jpg", StringComparison.CurrentCultureIgnoreCase) ||
                     ext.Equals(".png", StringComparison.CurrentCultureIgnoreCase) ||
                     ext.Equals(".bmp", StringComparison.CurrentCultureIgnoreCase) ||
                     ext.Equals(".gif", StringComparison.CurrentCultureIgnoreCase))
            {
                using (System.Drawing.Image image = System.Drawing.Image.FromFile(filename))
                {
                    _smallImageList.Images.Add(image.GetThumbnailImage(16, 16, new System.Drawing.Image.GetThumbnailImageAbort(GetThumbnailImageAbort), IntPtr.Zero));
                    _largeImageList.Images.Add(image.GetThumbnailImage(32, 32, new System.Drawing.Image.GetThumbnailImageAbort(GetThumbnailImageAbort), IntPtr.Zero));
                    retval = _smallImageList.Images.Count - 1;
                    _fileTypeIndecies.Add(filename, retval);
                }
            }
            else if (ext.Equals(".ico", StringComparison.CurrentCultureIgnoreCase))
            {
                using (Icon ico = new Icon(filename))
                {
                    Image img = ico.ToBitmap();
                    _smallImageList.Images.Add(img.GetThumbnailImage(16, 16, new System.Drawing.Image.GetThumbnailImageAbort(GetThumbnailImageAbort), IntPtr.Zero));
                    _largeImageList.Images.Add(img.GetThumbnailImage(32, 32, new System.Drawing.Image.GetThumbnailImageAbort(GetThumbnailImageAbort), IntPtr.Zero));
                    retval = _smallImageList.Images.Count - 1;
                    _fileTypeIndecies.Add(filename, retval);
                }
            }
            else
            {
                if (!_fileTypeIndecies.ContainsKey(ext))
                {
                    SHFILEINFO shinfo = new SHFILEINFO();
                    /*IntPtr hImgSmall =*/ shell32.SHGetFileInfo(ext, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), shell32.SHGFI_ICON | shell32.SHGFI_SMALLICON | shell32.SHGFI_USEFILEATTRIBUTES);
                    System.Drawing.Icon tmp = System.Drawing.Icon.FromHandle(shinfo.hIcon);
                    _smallImageList.Images.Add(tmp);
                    shell32.SHGetFileInfo(ext, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), shell32.SHGFI_ICON | shell32.SHGFI_LARGEICON | shell32.SHGFI_USEFILEATTRIBUTES);
                    tmp = System.Drawing.Icon.FromHandle(shinfo.hIcon);
                    _largeImageList.Images.Add(tmp);
                    retval = _smallImageList.Images.Count - 1;
                    _fileTypeIndecies.Add(ext, retval);
                }
                else
                {
                    retval = (int)_fileTypeIndecies[ext];
                }
            }
            return(retval);
        }
예제 #46
0
 internal Icon(System.Drawing.Icon icon)
 {
     this.hicon = icon.ToBitmap().GetHicon();
 }
예제 #47
0
        public void CreateIcons(string path, Control flowPanel)
        {
            Form1 fm1 = new Form1();
            //get ICON
            var hImgLarge = Win32.SHGetFileInfo(path, 0,
            ref shinfo, (uint)Marshal.SizeOf(shinfo),
            Win32.SHGFI_ICON | Win32.SHGFI_LARGEICON);

            //The icon is returned in the hIcon member of the shinfo struct
            System.Drawing.Icon myIcon = System.Drawing.Icon.FromHandle(shinfo.hIcon);

            //create label text  
            string name = Path.GetFileNameWithoutExtension(path);
            Label lb = new Label();
            Icon ico = Icon.ExtractAssociatedIcon(path);
            PictureBox pic = new PictureBox();
            pic.AllowDrop = true;
            if (fm1.fixedsingleborder == true)
            {
                pic.BorderStyle = BorderStyle.FixedSingle;
            }
            else if (fm1.fixed3dborder == true)
            {
                pic.BorderStyle = BorderStyle.Fixed3D;
            }
            else if (fm1.noborder == true)
            {
                pic.BorderStyle = BorderStyle.None;
            }
            int height = 85;
            int width = 90;
            pic.SizeMode = PictureBoxSizeMode.CenterImage;
            pic.BackColor = Color.Transparent;
            pic.Height = height;
            pic.Width = width;
            pic.Location = new Point(0, 0);
            pic.Name = path;
            pic.Image = ico.ToBitmap();
            path = String.Format("{0}", path);
            pic.Tag = path;
            pic.ContextMenuStrip = fm1.contextMenuStrip1;

            pic.MouseDown += new MouseEventHandler(Pic_MouseDown);
            pic.MouseUp += new MouseEventHandler(Pic_MouseUp);
            pic.DragOver += new DragEventHandler(Pic_DragOver);

            pic.MouseHover += new EventHandler(this.Pic_MouseHover);
            pic.MouseLeave += new EventHandler(this.Pic_MouseLeave);
            pic.DoubleClick += new EventHandler(this.Pic_DoubleClick);
            pic.MouseEnter += new EventHandler(this.Pic_MouseEnter);


            string newpath_app = Path.GetFileNameWithoutExtension(path);
            string f = Path.GetFileNameWithoutExtension(path);
            string fileNameNoExt = Path.GetFileNameWithoutExtension(path);

            Point p = new Point(0, 65);
            lb.Padding.All.Equals(10);
            lb.Margin.All.Equals(20);
            lb.Text = f;
            lb.Font.Bold.Equals(true);
            lb.Parent = pic;
            lb.BackColor = Color.Transparent;
            if (Properties.Settings.Default.piBoxLabelForeColor != null)
            {
                lb.ForeColor = Properties.Settings.Default.piBoxLabelForeColor;
            }
            else
            {
                lb.ForeColor = Color.Gray;
            }

            lb.BringToFront();
            lb.Location = p;

            flowPanel.Controls.Add(pic);


            // LOAD ALL FOLDERS!!!!!
            string[] folders = System.IO.Directory.GetDirectories(Environment.CurrentDirectory + @"\theDropFiles\", "*", System.IO.SearchOption.TopDirectoryOnly);
            foreach (var subdirs in folders)
            {
                string folderPath = subdirs;
                string lastFolderName = Path.GetFileName(folderPath.TrimEnd(Path.DirectorySeparatorChar));
                string fName = subdirs;
                //var hImgLarge;
                //Use this to get the small Icon
                // var hImgSmall = Win32.SHGetFileInfo(fName, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), Win32.SHGFI_ICON | Win32.SHGFI_SMALLICON);

                //Use this to get the large Icon
                var hImgLarge = Win32.SHGetFileInfo(fName, 0,
                ref shinfo, (uint)Marshal.SizeOf(shinfo),
                Win32.SHGFI_ICON | Win32.SHGFI_LARGEICON);

                //The icon is returned in the hIcon member of the shinfo struct
                System.Drawing.Icon myIco = System.Drawing.Icon.FromHandle(shinfo.hIcon);

              



                pic.AllowDrop = true;
                pic.MouseHover += new EventHandler(this.Pic_MouseHover);
                pic.MouseLeave += new EventHandler(this.Pic_MouseLeave);
                pic.DoubleClick += new EventHandler(this.Pic_DoubleClick);
                pic.MouseEnter += new EventHandler(this.Pic_MouseEnter);
                pic.MouseDown += new MouseEventHandler(this.Pic_MouseDown);
                pic.MouseUp += new MouseEventHandler(this.Pic_MouseUp);
                pic.DragOver += new DragEventHandler(this.Pic_DragOver);
                //path_app is a string for the filename.  
                path = String.Format("{0}", subdirs);
                // Add tag to each picturebox created with filename as the tag
                string path = lastFolderName;
                pic.Tag = path;

                //MODIFY the PICTUREBOX
                if (fm1.fixedsingleborder == true)
                {
                    pic.BorderStyle = BorderStyle.FixedSingle;
                }
                else if (fm1.fixed3dborder == true)
                {
                    pic.BorderStyle = BorderStyle.Fixed3D;
                }
                else if (fm1.noborder == true)
                {
                    pic.BorderStyle = BorderStyle.None;
                }
                pic.SizeMode = PictureBoxSizeMode.CenterImage;
                pic.BackColor = Color.Transparent;
                pic.Height = height;
                pic.Width = width;
                Point p = new Point(0, 65);
                pic.ContextMenuStrip = fm1.contextMenuStrip1; mijknb





                   \
]"                lb.Parent = pic;
                lb.BackColor = Color.Transparent;
                lb.BringToFront();
                lb.Location = p;
                pic.Name = fName;
                if (Properties.Settings.Default.piBoxLabelForeColor != null)
                {
                    lb.ForeColor = Properties.Settings.Default.piBoxLabelForeColor;
                }
                else
                {
                    lb.ForeColor = Color.Gray;  
                }
                flowPanel.Controls.Add(pic);

                try
                {
                    pic.Image = myIcon.ToBitmap();
                }
                catch (ArgumentException ae)
                {
                    MessageBox.Show("Error: " + ae.Message, "Couldn't find file!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
예제 #48
0
        private void frmArticulos_Load(object sender, EventArgs e)
        {
            this.CenterToScreen();
            cmbGenero.Validating    += new System.ComponentModel.CancelEventHandler(BL.Utilitarios.ValidarComboBox);
            cmbGenero.KeyDown       += new System.Windows.Forms.KeyEventHandler(BL.Utilitarios.EnterTab);
            cmbProveedor.Validating += new System.ComponentModel.CancelEventHandler(BL.Utilitarios.ValidarComboBox);
            cmbProveedor.KeyDown    += new System.Windows.Forms.KeyEventHandler(BL.Utilitarios.EnterTab);
            System.Drawing.Icon ico = Properties.Resources.icono_app;
            this.Icon       = ico;
            this.ControlBox = true;
            FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            Cursor.Current  = Cursors.WaitCursor;
            Clipboard.Clear();

            tblGeneros              = BL.GetDataBLL.Generos();
            cmbGenero.ValueMember   = "IdGeneroGEN";
            cmbGenero.DisplayMember = "DescripcionGEN";
            cmbGenero.DropDownStyle = ComboBoxStyle.DropDown;
            cmbGenero.DataSource    = tblGeneros;
            cmbGenero.SelectedValue = -1;
            AutoCompleteStringCollection generosColection = new AutoCompleteStringCollection();

            foreach (DataRow row in tblGeneros.Rows)
            {
                generosColection.Add(Convert.ToString(row["DescripcionGEN"]));
            }
            cmbGenero.AutoCompleteCustomSource = generosColection;
            cmbGenero.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
            cmbGenero.AutoCompleteSource       = AutoCompleteSource.CustomSource;

            tblProveedores             = BL.GetDataBLL.Proveedores();
            cmbProveedor.ValueMember   = "IdProveedorPRO";
            cmbProveedor.DisplayMember = "RazonSocialPRO";
            cmbProveedor.DropDownStyle = ComboBoxStyle.DropDown;
            cmbProveedor.DataSource    = tblProveedores;
            cmbProveedor.SelectedValue = -1;
            AutoCompleteStringCollection proveedorColection = new AutoCompleteStringCollection();

            foreach (DataRow row in tblProveedores.Rows)
            {
                proveedorColection.Add(Convert.ToString(row["RazonSocialPRO"]));
            }
            cmbProveedor.AutoCompleteCustomSource = proveedorColection;
            cmbProveedor.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
            cmbProveedor.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            tblArticulos.TableName          = "Articulos";
            bindingSource1.DataSource       = tblArticulos;
            bindingNavigator1.BindingSource = bindingSource1;
            viewArticulos           = new DataView(tblArticulos);
            tblArticulos.PrimaryKey = new DataColumn[] { tblArticulos.Columns["IdArticuloART"] };
            bindingSource1.Filter   = "IdArticuloART LIKE '000000000'";
            gvwDatos.DataSource     = bindingSource1;
            gvwDatos.Columns["IdArticuloART"].HeaderText    = "Código";
            gvwDatos.Columns["DescripcionART"].HeaderText   = "Descripción";
            gvwDatos.Columns["PrecioCostoART"].HeaderText   = "Precio costo";
            gvwDatos.Columns["PrecioPublicoART"].HeaderText = "Precio público";
            gvwDatos.Columns["PrecioMayorART"].HeaderText   = "Precio mayor";
            gvwDatos.Columns["RazonSocialPRO"].HeaderText   = "Proveedor";
            gvwDatos.Columns["IdItemART"].Visible           = false;
            gvwDatos.Columns["IdGeneroART"].Visible         = false;
            gvwDatos.Columns["IdColorART"].Visible          = false;
            gvwDatos.Columns["IdAliculotaIvaART"].Visible   = false;
            gvwDatos.Columns["TalleART"].Visible            = false;
            gvwDatos.Columns["IdProveedorART"].Visible      = false;
            gvwDatos.Columns["DescripcionWebART"].Visible   = false;
            gvwDatos.Columns["FechaART"].Visible            = false;
            gvwDatos.Columns["ImagenART"].Visible           = false;
            gvwDatos.Columns["ImagenBackART"].Visible       = false;
            gvwDatos.Columns["ImagenColorART"].Visible      = false;
            gvwDatos.Columns["ActivoWebART"].Visible        = false;
            gvwDatos.Columns["NuevoART"].Visible            = false;
            gvwDatos.SelectionMode         = DataGridViewSelectionMode.FullRowSelect;
            gvwDatos.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 7);
            if (origenMenu)
            {
                SetStateForm(FormState.inicial);
            }
            Cursor.Current = Cursors.Arrow;
            txtParametros.Focus();
        }
예제 #49
0
        private System.Windows.Media.ImageSource ConvertIconToImageSource(VistaTaskDialogIcon icon, Icon customIcon, bool isLarge)
        {
            System.Windows.Media.ImageSource iconSource = null;
            System.Drawing.Icon   sysIcon = null;
            System.Drawing.Bitmap altBmp  = null;

            try
            {
                switch (icon)
                {
                default:
                case VistaTaskDialogIcon.None:
                    break;

                case VistaTaskDialogIcon.Information:
                    sysIcon = SystemIcons.Information;
                    break;

                case VistaTaskDialogIcon.Warning:
                    sysIcon = SystemIcons.Warning;
                    break;

                case VistaTaskDialogIcon.Error:
                    sysIcon = SystemIcons.Error;
                    break;

                case VistaTaskDialogIcon.Shield:
                    if (isLarge)
                    {
                        altBmp = Properties.Resources.shield_32;
                    }
                    else
                    {
                        altBmp = Properties.Resources.shield_16;
                    }
                    break;
                }

                // Custom Icons always take priority
                if (customIcon != null)
                {
                    iconSource = System.Windows.Interop.Imaging.CreateBitmapSourceFromHIcon(
                        customIcon.Handle,
                        System.Windows.Int32Rect.Empty,
                        System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
                }
                else if (sysIcon != null)
                {
                    iconSource = System.Windows.Interop.Imaging.CreateBitmapSourceFromHIcon(
                        sysIcon.Handle,
                        System.Windows.Int32Rect.Empty,
                        System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
                }
                else if (altBmp != null)
                {
                    iconSource = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
                        altBmp.GetHbitmap(),
                        IntPtr.Zero,
                        System.Windows.Int32Rect.Empty,
                        System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
                }
            }
            finally
            {
                // Not responsible for disposing of custom icons

                if (sysIcon != null)
                {
                    sysIcon.Dispose();
                }
                if (altBmp != null)
                {
                    altBmp.Dispose();
                }
            }

            return(iconSource);
        }
예제 #50
0
        /// <summary>
        /// Creates and initiallizes form.
        /// </summary>
        public Form1()
        {
            InitializeComponent();
            this.AutoScaleMode = AutoScaleMode.Font;
            try
            {
                System.Drawing.Icon ico = new System.Drawing.Icon(GetIconFile(GetIconFile(@"..\\..\\\logo.ico")));
                this.Icon = ico;
            }
            catch { }
            Customization();
            // Creates new file using C# language configuration.
            editControl1.NewFile(editControl1.Configurator["C#"]);

            // Creates format for methods coloring.
            ISnippetFormat formatMethod = editControl1.Language.Add("Method", "Text");

            formatMethod.FontColor = Color.HotPink;

            // Creates format for properties coloring.
            ISnippetFormat formatProperty = editControl1.Language.Add("Property", "Text");

            formatProperty.FontColor = Color.Goldenrod;

            // Disables ContextChoiceList dropping after dot in global context.
            ConfigLexem lexemDot_ = GetConfigLexem((IConfigLexem)editControl1.Language, ".");

            lexemDot_.DropContextChoiceList = false;

            // Adds "this" word processing for global context.
            ConfigLexem lexemThis = GetConfigLexem((IConfigLexem)editControl1.Language, "this");

            lexemThis.Type = FormatType.String;
            // "this" starts it`s own context. It does not have EndBlock specified, so the first unprocessed token will force parser to exit from "this"'s context.
            lexemThis.IsComplex = true;

            // Adds "." processing for "this" context: if "this" is followed by "." then the dot will
            // have "lexemDot" configuration.
            ConfigLexem lexemDot = GetConfigLexem((IConfigLexem)lexemThis, ".");

            lexemDot.Type = FormatType.Operator;
            // "." can drop context choice list
            lexemDot.DropContextChoiceList = true;
            lexemDot.IsComplex             = true;

            // Add configuration for "Property1"
            ConfigLexem this_Property1 = GetConfigLexem((IConfigLexem)lexemDot, "Property1");

            this_Property1.Type      = FormatType.Custom; this_Property1.FormatName = "Property";
            this_Property1.IsComplex = true;

            // Add configuration for "." after "Property1"
            ConfigLexem propertyDot = GetConfigLexem((IConfigLexem)this_Property1, ".");

            propertyDot.Type = FormatType.Operator;
            propertyDot.DropContextChoiceList = true;
            propertyDot.IsComplex             = true;
            propertyDot.Priority = 10;

            // Add "Method1" configuration after "this.Property1."
            ConfigLexem property_Method1 = GetConfigLexem((IConfigLexem)propertyDot, "Method1");

            property_Method1.Type      = FormatType.Custom; property_Method1.FormatName = "Method";
            property_Method1.IsComplex = true;

            // Add "Method2" configuration after "this.Property1."
            ConfigLexem property_Method2 = GetConfigLexem((IConfigLexem)propertyDot, "Method2");

            property_Method2.Type      = FormatType.Custom; property_Method2.FormatName = "Method";
            property_Method2.IsComplex = true;

            // Add "TestMethod" configuration after "this."
            ConfigLexem this_Method1 = GetConfigLexem((IConfigLexem)lexemDot, "TestMethod");

            this_Method1.Type = FormatType.Custom; this_Method1.FormatName = "Method";
            // needed for processing "(" and ")" next.
            this_Method1.IsComplex = true;

            // Add "GenerateMap" configuration after "this."
            ConfigLexem this_Method2 = GetConfigLexem((IConfigLexem)lexemDot, "GenerateMap");

            this_Method2.Type = FormatType.Custom; this_Method2.FormatName = "Method";
            // needed for processing "(" and ")" next.
            this_Method2.IsComplex = true;

            // Adds processing of the "(" after "this.Property1.Method1"
            ConfigLexem this_Method1_Braces = GetConfigLexem((IConfigLexem)this_Method1, "(");

            //Processing is done until ")" is found.
            this_Method1_Braces.EndBlock = ")";
            this_Method1_Braces.Type     = FormatType.Operator;
            // Lexem with this config starts it`s own context.
            this_Method1_Braces.IsComplex = true;
            // ContextPrompt is dropped after entering "("
            this_Method1_Braces.DropContextPrompt = true;
            // Needed to override "(" from the global context.
            this_Method1_Braces.Priority = 10;

            ConfigLexem this_Method2_Braces = GetConfigLexem((IConfigLexem)this_Method2, "(");

            this_Method2_Braces.EndBlock          = ")";
            this_Method2_Braces.Type              = FormatType.Operator;
            this_Method2_Braces.IsComplex         = true;
            this_Method2_Braces.DropContextPrompt = true;
            this_Method2_Braces.Priority          = 10;

            // ResetCaches needed for resetting all configuration caches. Without ResetCaches user changes will not be used.
            editControl1.Language.ResetCaches();

            // Fills collection of descriptions for lexemes with different configurations.
            m_MethodComments[this_Method1.ID]     = "Test description";
            m_MethodComments[this_Method2.ID]     = "Generates Some Specific Map....or just tests descriptions in context choice list";
            m_MethodComments[this_Property1.ID]   = "The only one property\nIt has multiline description";
            m_MethodComments[property_Method1.ID] = "Method 1";
            m_MethodComments[property_Method2.ID] = "Method 2";

            // Fills collection of prompts, assigned to different lexeme configurations.
            m_MethodPrompts[this_Method1.ID] = new DictionaryEntry[]
            {
                new DictionaryEntry(this_Method1.BeginBlock + "()", m_MethodComments[this_Method1.ID]),
                new DictionaryEntry(this_Method1.BeginBlock + "( int testData )",
                                    (string)m_MethodComments[this_Method1.ID] + "\ntestData should be specified"),
                new DictionaryEntry(this_Method1.BeginBlock + "( int testData, string testParam )",
                                    (string)m_MethodComments[this_Method1.ID] + "\ntestData and testParam should be specified")
            };

            m_MethodPrompts[this_Method2.ID] = new DictionaryEntry[]
            {
                new DictionaryEntry(this_Method2.BeginBlock + "()", m_MethodComments[this_Method2.ID])
            };

            // Sets text to be displayed.
            editControl1.Text = @"/* To see how the Context Choice list works, type ""this."" or ""this.Property1."" (if you have closed the popup window, you can re-open it with CTRL+Space shortcut)

To see how the Context ToolTip works move the mouse over some text and you will see information tooltip about text under cursor and description, if available.

To see how the Context Prompt feature works, type ""this.TestMethod("" and you will see list of the overloaded implementations of ""TestMethod"" methods. */

// Examples:  
this. //<- Press CTRL+Space to display the context choice list.

this.TestMethod( //<- Press CTRL+SHIFT+Space after ""("" to display the contextprompt items.

this.GenerateMap(); // Move the mouse over ""GenerateMap"" to see the context tooltip.
";

            // Resets undo buffer, so the user cannot undo setting of the text.
            editControl1.ResetUndoInfo();
        }
예제 #51
0
        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.editControl1.UserMarginBackgroundColor = new BrushInfo(GradientStyle.ForwardDiagonal, Color.Beige, Color.Orange);
            this.editControl1.ShowUserMargin            = false;
            //this.usermarginItem.Checked = false;

            this.edtProperties.Visible = false;
            //this.propertiesgridItem.Checked = false;

            this.editControl1.ShowWhitespaces = false;
            //this.whitespacesItem.Checked = false;

            this.editControl1.ShowUserMargin = false;
            //this.usermarginItem.Checked = false;

            this.editControl1.StatusBarSettings.Visible = true;
            //this.statusbarItem.Checked = true;

            this.editControl1.ShowHorizontalScroller = true;
            this.editControl1.ShowVerticalScroller   = true;
            this.scrollbarBtn.Checked = true;

            this.editControl1.ShowHorizontalSplitters = true;
            this.editControl1.ShowVerticalSplitters   = true;
            this.splittersBtn.Checked = true;

            this.editControl1.ShowLineNumbers = true;
            //this.linenumberItem.Checked = true;

            this.editControl1.ShowIndicatorMargin = true;
            this.editControl1.MarkerAreaWidth     = 20;
            //this.indicatorItem.Checked = true;

            this.editControl1.ShowOutliningCollapsers = true;
            //this.outliningItem.Checked = true;

            this.editControl1.ShowIndentationGuidelines = true;
            this.indentationBtn.Checked = true;

            this.editControl1.ShowSelectionMargin            = false;
            this.editControl1.SelectionMarginWidth           = 25;
            this.editControl1.SelectionMarginBackgroundColor = Color.IndianRed;
            this.editControl1.SelectionMarginForegroundColor = Color.DarkGray;
            //this.selectionmarginItem.Checked = false;

            this.editControl1.StatusBarSettings.Visible                  = true;
            this.editControl1.StatusBarSettings.TextPanel.Visible        = true;
            this.editControl1.StatusBarSettings.StatusPanel.Visible      = true;
            this.editControl1.StatusBarSettings.EncodingPanel.Visible    = true;
            this.editControl1.StatusBarSettings.CoordsPanel.Visible      = true;
            this.editControl1.StatusBarSettings.InsertPanel.Visible      = true;
            this.editControl1.StatusBarSettings.TextPanel.Panel.Text     = filePath;
            this.editControl1.StatusBarSettings.StatusPanel.Panel.Text   = "Edit Features";
            this.editControl1.StatusBarSettings.EncodingPanel.Panel.Text = "Parsing Mode : " + this.editControl1.ParsingMode.ToString();
            this.editControl1.StatusBarSettings.CoordsPanel.Panel.Text   = Control.MousePosition.ToString();
            this.editControl1.StatusBarSettings.InsertPanel.Panel.Text   = "Insert Key : " + (this.editControl1.InsertMode == true? "ON": "OFF");
            this.statusBarBtn.Checked = true;
            try
            {
                System.Drawing.Icon ico = new System.Drawing.Icon(GetIconFile(GetIconFile(@"..\\..\\\logo.ico")));
                this.Icon = ico;
            }
            catch { }
            Customization();


            this.editControl1.LoadFile(filePath);

            this.Size = new Size(664, 500);
        }
 public CustomVisualStyleDialog(Form1 form)
 {
     Mainform = form;
     InitializeComponent();
     BrushNames.Add("BackgroundColor");
     BrushNames.Add("OuterFrameBackgroundColor");
     BrushNames.Add("InnerFrameBackgroundColor");
     BrushNames.Add("ArcColor");
     BrushNames.Add("MinorTickMarkColor");
     BrushNames.Add("MajorTickMarkColor");
     BrushNames.Add("InterLinesColor");
     BrushNames.Add("ScaleLabelColor");
     BrushNames.Add("NeedlePointerColor");
     BrushNames.Add("GaugeLabelColor");
     BrushNames.Add("GaugeValueColor");
     for (int i = 0; i < 11; i++)
     {
         ThemeChoiceControl themeChoiceControl = new ThemeChoiceControl();
         themeChoiceControl.Padding             = new System.Windows.Forms.Padding(themeChoiceControl.Padding.Left, themeChoiceControl.Padding.Top, themeChoiceControl.Padding.Right, themeChoiceControl.Padding.Bottom);
         themeChoiceControl.ColorPicker.Picked += ColorPicker_Picked;
         themeChoiceControl.BrushName.Text      = BrushNames[i];
         if (themeChoiceControl.BrushName.Text == "BackgroundColor")
         {
             if (Mainform.RestoreColors.Keys.Contains <string>("BackgroundColor"))
             {
                 UpdateColors(themeChoiceControl, "BackgroundColor");
             }
             else
             {
                 themeChoiceControl.buttonEdit1.Text = "#FFFFFF";
             }
         }
         else if (themeChoiceControl.BrushName.Text == "OuterFrameBackgroundColor")
         {
             if (Mainform.RestoreColors.Keys.Contains <string>("OuterFrameBackgroundColor"))
             {
                 UpdateColors(themeChoiceControl, "OuterFrameBackgroundColor");
             }
             else
             {
                 themeChoiceControl.buttonEdit1.Text = "#c5c5c5";
             }
         }
         else if (themeChoiceControl.BrushName.Text == "InnerFrameBackgroundColor")
         {
             if (Mainform.RestoreColors.Keys.Contains <string>("InnerFrameBackgroundColor"))
             {
                 UpdateColors(themeChoiceControl, "InnerFrameBackgroundColor");
             }
             else
             {
                 themeChoiceControl.buttonEdit1.Text = "#FFFFFF";
             }
         }
         else if (themeChoiceControl.BrushName.Text == "ArcColor")
         {
             if (Mainform.RestoreColors.Keys.Contains <string>("ArcColor"))
             {
                 UpdateColors(themeChoiceControl, "ArcColor");
             }
             else
             {
                 themeChoiceControl.buttonEdit1.Text = "#b5b5b5";
             }
         }
         else if (themeChoiceControl.BrushName.Text == "MinorTickMarkColor")
         {
             if (Mainform.RestoreColors.Keys.Contains <string>("MinorTickMarkColor"))
             {
                 UpdateColors(themeChoiceControl, "MinorTickMarkColor");
             }
             else
             {
                 themeChoiceControl.buttonEdit1.Text = "#b5b5b5";
             }
         }
         else if (themeChoiceControl.BrushName.Text == "MajorTickMarkColor")
         {
             if (Mainform.RestoreColors.Keys.Contains <string>("MajorTickMarkColor"))
             {
                 UpdateColors(themeChoiceControl, "MajorTickMarkColor");
             }
             else
             {
                 themeChoiceControl.buttonEdit1.Text = "#3d3d3d";
             }
         }
         else if (themeChoiceControl.BrushName.Text == "InterLinesColor")
         {
             if (Mainform.RestoreColors.Keys.Contains <string>("InterLinesColor"))
             {
                 UpdateColors(themeChoiceControl, "InterLinesColor");
             }
             else
             {
                 themeChoiceControl.buttonEdit1.Text = "#3d3d3d";
             }
         }
         else if (themeChoiceControl.BrushName.Text == "NeedlePointerColor")
         {
             if (Mainform.RestoreColors.Keys.Contains <string>("NeedlePointerColor"))
             {
                 UpdateColors(themeChoiceControl, "NeedlePointerColor");
             }
             else
             {
                 themeChoiceControl.buttonEdit1.Text = "#0173c7";
             }
         }
         else if (themeChoiceControl.BrushName.Text == "ScaleLabelColor")
         {
             if (Mainform.RestoreColors.Keys.Contains <string>("ScaleLabelColor"))
             {
                 UpdateColors(themeChoiceControl, "ScaleLabelColor");
             }
             else
             {
                 themeChoiceControl.buttonEdit1.Text = "#5e5e5e";
             }
         }
         else if (themeChoiceControl.BrushName.Text == "GaugeLabelColor")
         {
             if (Mainform.RestoreColors.Keys.Contains <string>("GaugeLabelColor"))
             {
                 UpdateColors(themeChoiceControl, "GaugeLabelColor");
             }
             else
             {
                 themeChoiceControl.buttonEdit1.Text = "#5e5e5e";
             }
         }
         else if (themeChoiceControl.BrushName.Text == "GaugeValueColor")
         {
             if (Mainform.RestoreColors.Keys.Contains <string>("GaugeValueColor"))
             {
                 UpdateColors(themeChoiceControl, "GaugeValueColor");
             }
             else
             {
                 themeChoiceControl.buttonEdit1.Text = "#5e5e5e";
             }
         }
         if (themeChoiceControl.buttonEdit1.Text == "#FFFFFF")
         {
             themeChoiceControl.buttonEditChildButton1.MetroColor = Color.Wheat;
         }
         else
         {
             themeChoiceControl.buttonEditChildButton1.MetroColor = ColorTranslator.FromHtml(themeChoiceControl.buttonEdit1.Text);
         }
         this.flowLayoutPanel1.Controls.Add(themeChoiceControl);
         previousColors.Add(themeChoiceControl.BrushName.Text, themeChoiceControl.buttonEditChildButton1.MetroColor);
     }
     this.FormClosing  += Form2_FormClosing;
     this.StartPosition = FormStartPosition.CenterParent;
     try
     {
         System.Drawing.Icon ico = new System.Drawing.Icon(GetIconFile(@"common\Images\Grid\Icon\sfgrid1.ico"));
         this.Icon = ico;
     }
     catch { }
 }
예제 #53
0
        public Form1()
        {
            #region private members
            // adjust behavior of performance sanoke with the following properties
            useGDI = true;
            usePrepareViewStyleInfo = false;
            showHeaders             = true;
            drawBorder             = true;
            useDoubleBuffer        = false;
            optimizeDrawBackground = true;
            iterationsPerUpdate    = 3;
            insertRemoveInterval   = 1;
            timerInterval          = 20;
            sleep = 0;

            useDoubleBuffer |= !useGDI;
            #endregion

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            if (DpiAware.GetCurrentDpi() > 96)
            {
                this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight);
            }
            try
            {
                System.Drawing.Icon ico = new System.Drawing.Icon(GetIconFile(@"Common\Images\Grid\Icon\sficon.ico"));
                this.Icon = ico;
            }
            catch { }
            this.MetroColor = System.Drawing.Color.Transparent;

            #region Grid Control's properties
            this.grid = new PerformanceGrid();
            this.grid.Model.UseGridNonVirtualDataCache = true;
            this.grid.UseGDI                    = useGDI;
            this.grid.UseDoubleBuffer           = useDoubleBuffer;
            this.grid.OptimizeDrawBackground    = optimizeDrawBackground;
            this.grid.OptimizeInsertRemoveCells = true;
            GridStyleInfo.Default.Trimming      = StringTrimming.None;        // Default is StringTrimming.Char which forces
            // GridGDIPaint.DrawText to use NativeMethods.DrawText instead of NativeMethods.ExtTextOut

            // PrepareViewStyleInfo lets you modify a temporary copy of style objects, and change
            // appearance without saving changes to volatile data cache. However, this is a bit
            // slower than modifying contents directly.
            this.grid.SupportsPrepareViewStyleInfo = usePrepareViewStyleInfo;

            this.grid.Model[0, 0].Text = " ";

            if (usePrepareViewStyleInfo)
            {
                grid.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(grid_PrepareViewStyleInfo);
            }

            if (drawBorder)
            {
                // Use solid line - faster than dotted line
                grid.Model.TableStyle.Borders.Bottom = new GridBorder(GridBorderStyle.Solid, SystemColors.Control, GridBorderWeight.Thin);
                grid.Model.TableStyle.Borders.Right  = new GridBorder(GridBorderStyle.Solid, SystemColors.Control, GridBorderWeight.Thin);
            }
            else
            {
                // No border at all is of course faster.
                grid.Model.TableStyle.Borders.All = GridBorder.Empty;                //new GridBorder(GridBorderStyle.Dotted, SystemColors.ControlLight, GridBorderWeight.Thin);//GridBorder.Empty;
            }
            if (!showHeaders)
            {
                grid.Model.HideRows[0] = true;
                grid.Model.HideCols[0] = true;
            }

            highlightColumn = -3;
            #endregion

            #region Generic properties
            this.grid.DpiAware = true;
            this.grid.Anchor   = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            Size clientSize = this.ClientSize;
            clientSize.Height                    -= statusBar1.Height;
            this.grid.Location                    = new Point(this.Location.X + 10, this.Location.Y + 10);
            clientHeight                          = 14 * this.grid.DefaultRowHeight;
            this.grid.Size                        = new Size(this.Size.Width - 30, clientHeight);
            this.Size                             = new Size(this.Size.Width, this.grid.Size.Height + this.statusBar1.Height + 75);
            this.grid.HScrollPixel                = true;
            this.grid.VScrollPixel                = true;
            this.grid.HorizontalThumbTrack        = true;
            this.grid.VerticalThumbTrack          = true;
            this.grid.TableStyle.Enabled          = false;
            grid.Model.Options.NumberedRowHeaders = false;
            grid.Model.Options.NumberedColHeaders = false;
            this.Controls.Add(this.grid);
            this.model = new Model(10, 10);
            GridStyleInfo style = grid.BaseStylesMap["Header"].StyleInfo;
            style.TextColor     = Color.MidnightBlue;
            style.Font.Facename = "Verdana";
            style.Borders.All   = new GridBorder(GridBorderStyle.Solid, Color.LightGray, GridBorderWeight.Thin);

            SynchronizeModel();
            this.grid.ThemesEnabled    = true;
            this.grid.GridVisualStyles = Syncfusion.Windows.Forms.GridVisualStyles.Metro;
            grid.Refresh();

            #endregion

            #region Timer

            this.timer          = new System.Windows.Forms.Timer();
            this.timer.Interval = timerInterval;
            this.timer.Tick    += new EventHandler(this.OnUpdate);
            this.timer.Start();

            #endregion
        }
예제 #54
0
 public Icon()
 {
     icon1 = SystemIcons.Question;
 }
예제 #55
0
        private void OnMainFormLoad(object sender, System.EventArgs e)
        {
            try
            {
                SuspendLayout();
                try
                {
                    SimulationController.ApsimData.DirtyChanged    += OnDirtyChanged;
                    SimulationController.ApsimData.FileNameChanged += OnFileNameChanged;

                    // Load some assemblies for later. The code for some actions are found in
                    // these assemblies.
                    Assembly.Load("Actions");
                    Assembly.Load("CSUserInterface");
                    Assembly.Load("CPIUserInterface");
                    Assembly.Load("Graph");
                    //Assembly.Load("Soils")

                    // Position window correctly after the scaling has been done.
                    try
                    {
                        int _Height = 0;
                        int _Width  = 0;
                        WindowState = (FormWindowState)Convert.ToInt32(Configuration.Instance.Setting("windowstate"));
                        string s = Configuration.Instance.Setting("top");
                        if (s != "")
                        {
                            Top = Convert.ToInt32(s);
                        }
                        else
                        {
                            Top = 1;
                        }
                        if ((Top <0 | Top> this.Height))
                        {
                            Top = 1;
                        }
                        s = Configuration.Instance.Setting("left");
                        if (s != "")
                        {
                            Left = Convert.ToInt32(s);
                        }
                        else
                        {
                            Left = 1;
                        }
                        if ((Left <0 | Left> this.Width))
                        {
                            Left = 1;
                        }
                        s = Configuration.Instance.Setting("height");
                        if (s != "")
                        {
                            _Height = Convert.ToInt32(s);
                        }
                        else
                        {
                            _Height = 400;
                        }

                        s = Configuration.Instance.Setting("width");
                        if (s != "")
                        {
                            _Width = Convert.ToInt32(s);
                        }
                        else
                        {
                            _Height = 600;
                        }

                        if ((_Height == 0 | _Width == 0))
                        {
                            _Height = 400;
                            _Width  = 600;
                        }
                        this.Height = _Height;
                        this.Width  = _Width;
                    }
                    catch (System.Exception)
                    {
                        this.WindowState = FormWindowState.Maximized;
                    }

                    //Try and load an icon from configuration. (Splash Screen?)
                    string IconFileName = Configuration.Instance.Setting("Icon");
                    if (!string.IsNullOrEmpty(IconFileName) && File.Exists(IconFileName))
                    {
                        Icon = new System.Drawing.Icon(IconFileName);
                    }

                    //Create the MainToolBar
                    SimulationController.ProvideToolStrip(SimulationToolStrip, "MainToolBar");
                    if (Configuration.Instance.Setting("HideMainMenu") == "Yes")
                    {
                        SimulationToolStrip.Visible = false;
                    }

                    //Show the Simulation Explorer.
                    SimulationExplorer.OnLoad(SimulationController);
                    SimulationController.Explorer = SimulationExplorer;
                    //give the explorer ui to the controller.

                    // Process command line arguments.
                    // Load a file if one was specified on the command line.
                    string ExportDirectory = "";
                    string ExportExtension = "";
                    if ((Control.ModifierKeys != Keys.Control) && (Args.Count > 0))
                    {
                        foreach (string Arg in Args)
                        {
                            if ((Arg == "Export") && (Args.Count == 4))
                            {
                                ExportDirectory = Args[2];
                                ExportExtension = Args[3];
                                SimulationController.isExporting = true;
                                break;
                            }
                            else if (Arg == "PredictedObserved")
                            {
                                ExportDirectory     = Args[2];
                                DoPredictedObserved = true;
                                break;
                            }
                            else
                            {
                                string FileName = Arg.Replace("\"", "");
                                if (FileName.Length > 0)
                                {
                                    if (Path.GetFileName(FileName).ToLower() == "response.file")
                                    {
                                        GraphWizardForm Wizard = new GraphWizardForm();
                                        Wizard.Go(SimulationController, FileName);
                                        Wizard.ShowDialog();
                                    }
                                    else
                                    {
                                        SimulationController.ApsimData.OpenFile(FileName);
                                    }
                                }
                            }
                        }
                    }

                    // If no file loaded then load previous one.
                    if (Control.ModifierKeys != Keys.Control & SimulationController.ApsimData.FileName.Length == 0)
                    {
                        SimulationController.LoadPreviousFile();
                    }

                    // If we have an export file name then do an export.
                    if (!string.IsNullOrEmpty(ExportDirectory) && ExportExtension != string.Empty)
                    {
                        Actions.BaseActions.ExportAll(SimulationController, SimulationController.ApsimData.RootComponent, ExportDirectory, ExportExtension);
                        Close();
                    }
                    else if (DoPredictedObserved)
                    {
                        Actions.BaseActions.DoPredictedObserved(SimulationController, SimulationController.ApsimData.RootComponent, ExportDirectory);
                        Close();
                    }
                    else
                    {
                        //Create the Toolbox Explorer
                        bool ToolboxesVisible = Configuration.Instance.Setting("ToolboxesVisible").ToLower() == "yes";
                        if (ToolboxesVisible)
                        {
                            // Setup but don't show the Toolbox Explorer.
                            ToolboxController = new BaseController(null, ApplicationName, false);

                            ToolboxExplorer        = new ExplorerUI();
                            ToolboxExplorer.Name   = "ToolboxExplorer";
                            ToolboxExplorer.Parent = ToolBoxPanel;
                            ToolboxExplorer.Dock   = DockStyle.Fill;
                            ToolboxExplorer.BringToFront();
                            ToolboxExplorer.OnLoad(ToolboxController);

                            ToolboxController.Explorer = ToolboxExplorer;
                            //give the toolbox ExplorerUI to the toolbox controller.
                            try
                            {
                                PopulateToolBoxStrip();
                                //populate the Toolbox Strip with all the different Toolboxes
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                        }
                        else
                        {
                            ToolBoxesToolStrip.Visible = false;
                        }
                        UpdateCaption();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            finally
            {
                ResumeLayout(true);
            }
        }
예제 #56
0
        private void HomePage_Load(object sender, EventArgs e)
        {
            pictureBox1.Image = Image.FromFile("Assets/account.png");
            System.Drawing.Icon ico = new System.Drawing.Icon("Assets/netflix.ico");
            this.Icon            = ico;
            pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            LoadingPage loading = new LoadingPage();

            loading.Show();
            if (ilkKayitMi == false)
            {
                tabControl1.TabPages.Remove(tabPage4);
            }
            else if (ilkKayitMi == true)
            {
                tabControl1.SelectedTab = tabPage4;
            }
            FilmList.Columns.Add("ID", 50);
            FilmList.Columns.Add("Adı", 200);
            FilmList.Columns.Add("Türü", 500);
            FilmList.Columns.Add("Uzunluğu", 165);
            ///FilmList.Columns.Add("Puanım", 100);
            FilmList.Columns.Add("Puan", 120);


            DiziList.Columns.Add("ID", 50);
            DiziList.Columns.Add("Adı", 200);
            DiziList.Columns.Add("Türü", 400);
            DiziList.Columns.Add("Uzunluğu", 160);
            DiziList.Columns.Add("Bölüm Sayısı", 100);
            ///DiziList.Columns.Add("Puanım", 100);
            DiziList.Columns.Add("Puan", 120);



            arananList.Columns.Add("ID", 50);
            arananList.Columns.Add("Adı", 200);
            arananList.Columns.Add("Türü", 460);
            arananList.Columns.Add("Tipi", 50);
            arananList.Columns.Add("Bölüm Sayısı", 100);
            arananList.Columns.Add("Uzunluğu", 100);
            ///arananList.Columns.Add("Puanım", 100);
            arananList.Columns.Add("Puan", 100);



            TakipEttigimProgramlarList.Columns.Add("ID", 50);
            TakipEttigimProgramlarList.Columns.Add("Adı", 200);
            TakipEttigimProgramlarList.Columns.Add("Türü", 460);
            TakipEttigimProgramlarList.Columns.Add("Tipi", 50);
            TakipEttigimProgramlarList.Columns.Add("Bölüm Sayısı", 100);
            TakipEttigimProgramlarList.Columns.Add("Uzunluğu", 100);
            ///arananList.Columns.Add("Puanım", 100);
            TakipEttigimProgramlarList.Columns.Add("Kaldığım Bölüm", 100);
            TakipEttigimProgramlarList.Columns.Add("Kaldığım Süre", 100);
            TakipEttigimProgramlarList.Columns.Add("Verdiğim Puan", 100);
            TakipEttigimProgramlarList.Columns.Add("Toplam Puan", 100);
            TakipEttigimProgramlarList.Columns.Add("İzleme Tarihi", 100);


            VerileriGetir();
            Search();
            System.Threading.Thread.Sleep(2000);
            this.Opacity = 100;
            loading.Hide();
        }
예제 #57
0
        private void Form1_Load(object sender, EventArgs e)
        {
            string updatedir = MyPath + "\\Update";
            string configdir = MyPath + "\\Config";

            if (File.Exists(MyPath + "\\res64.pak"))
            {
                resourceArchive = ZipFile.Open(MyPath + "\\res64.pak", ZipArchiveMode.Update);
            }
            else
            if (MessageBox.Show("Cannot start without res64.pak existing! Please create it.", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
            {
                Application.Exit();
            }
            SpeechSynthesizer.SetOutputToDefaultAudioDevice();
            if (Directory.Exists(updatedir))
            {
                foreach (FileInfo file in new DirectoryInfo(updatedir).EnumerateFiles())
                {
                    if (file.Extension == ".ypac")
                    {
                        Package.LoadPackage(file.FullName);
                    }
                }
            }
            timer1.Start();
            if (resourceArchive.GetEntry("game.ico") != null)
            {
                Icon = new System.Drawing.Icon(resourceArchive.GetEntry("game.ico").Open());
            }
            if (resourceArchive.GetEntry("gametitle") != null)
            {
                Text = (string)Tools.Read(resourceArchive.GetEntry("gametitle").Open());
                openToolStripMenuItem.Visible = false;
            }
            else
            {
                Text = "TextEngine";
            }

            if (resourceArchive.GetEntry("gametdesc") != null)
            {
                desc = (string)Tools.Read(resourceArchive.GetEntry("gamedesc").Open());
            }

            if (File.Exists(configdir + "\\colorscheme.xml"))
            {
                try
                {
                    Data colorscheme = Data.FromXMLFile(configdir + "\\colorscheme.xml");
                    menuStrip1.BackColor   = Color.FromName(colorscheme.GetValue(0));
                    menuStrip2.BackColor   = Color.FromName(colorscheme.GetValue(1));
                    pictureBox1.BackColor  = Color.FromName(colorscheme.GetValue(2));
                    richTextBox1.BackColor = Color.FromName(colorscheme.GetValue(3));
                    listView1.BackColor    = Color.FromName(colorscheme.GetValue(4));
                    playerText             = Color.FromName(colorscheme.GetValue(5));
                    otherText = Color.FromName(colorscheme.GetValue(6));
                    makeFore(menuStrip1);
                    makeFore(menuStrip2);
                    makeFore(pictureBox1);
                    makeFore(richTextBox1);
                    makeFore(listView1);
                    listView1.BorderStyle    = BorderStyle.None;
                    richTextBox1.BorderStyle = BorderStyle.None;
                    pictureBox1.BorderStyle  = BorderStyle.None;
                    if (listView1.BackColor != Color.White)
                    {
                        listView1.GridLines = false;
                    }
                } catch
                {
                    MessageBox.Show("colorscheme.xml may be corrupt! Please contact whoever provided you with this file.", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }



            if (File.Exists(configdir + "\\config.xml"))
            {
                Data data = Data.FromFile(configdir + "\\config.xml");
                if (!string.IsNullOrWhiteSpace(data.GetValue(0)))
                {
                    try
                    {
                        richTextBox1.Font = new Font(FontFamily.GenericSansSerif, (float)double.Parse(data.GetValue(0)), FontStyle.Regular);
                    }
                    catch
                    {
                    }
                }

                if (data.GetValue(1) != null)
                {
                    bool doubleClick = true;
                    bool.TryParse(data.GetValue(1), out doubleClick);
                    doubleClickToSelectToolStripMenuItem.Checked = doubleClick;
                }
                if (data.GetValue(2) != null)
                {
                    bool StoryTTS = true;
                    bool.TryParse(data.GetValue(2), out StoryTTS);
                    storyTTSToolStripMenuItem.Checked = StoryTTS;
                }
                if (data.GetValue(2) != null)
                {
                    bool selectionTTS = true;
                    bool.TryParse(data.GetValue(3), out selectionTTS);
                    selectedOptionTTSToolStripMenuItem.Checked = selectionTTS;
                }
            }

            if (File.Exists(configdir + "\\autosave.s"))
            {
                try
                {
                    var        archiveName    = (string)Tools.Read(configdir + "\\autosave.s");
                    ZipArchive currentArchive = ZipFile.OpenRead(archiveName);
                    LoadDialog(currentArchive, archiveName, resourceArchive);
                } catch
                {
                    MessageBox.Show("Autosave corrupt. Please delete the file and restart the program.", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else if (Directory.Exists(MyPath + "\\Story"))
            {
                try
                {
                    ZipArchive archive = ZipFile.Open(MyPath + "\\Story\\story.pak", ZipArchiveMode.Update);

                    currentArchive     = archive;
                    currentArchiveName = "\\Story\\story.pak";

                    LoadDialog(currentArchive, currentArchiveName, resourceArchive);
                    openToolStripMenuItem.Visible = false;
                }
                catch
                {
                    MessageBox.Show("Story file not found, loading manual mode. Please close the program if you have no idea what's happening and make sure to report this error.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            toolStripTextBox1.Text = richTextBox1.Font.Size.ToString();
        }
예제 #58
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TabAlignmentFrame));
     try
     {
         System.Drawing.Icon ico = new System.Drawing.Icon(GetIconFile(@"common\Images\Grid\Icon\sfgrid1.ico"));
         this.Icon = ico;
     }
     catch { }
     this.panel1         = new System.Windows.Forms.Panel();
     this.checkBox1      = new System.Windows.Forms.CheckBox();
     this.panel2         = new System.Windows.Forms.Panel();
     this.panel4         = new System.Windows.Forms.Panel();
     this.tabControlAdv2 = new Syncfusion.Windows.Forms.Tools.TabControlAdv();
     this.tabPageAdv3    = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
     this.label1         = new System.Windows.Forms.Label();
     this.tabPageAdv4    = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
     this.label5         = new System.Windows.Forms.Label();
     this.tabControlAdv1 = new Syncfusion.Windows.Forms.Tools.TabControlAdv();
     this.tabPageAdv1    = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
     this.label2         = new System.Windows.Forms.Label();
     this.tabPageAdv2    = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
     this.label6         = new System.Windows.Forms.Label();
     this.panel3         = new System.Windows.Forms.Panel();
     this.tabControlAdv4 = new Syncfusion.Windows.Forms.Tools.TabControlAdv();
     this.tabPageAdv7    = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
     this.label3         = new System.Windows.Forms.Label();
     this.tabPageAdv8    = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
     this.label7         = new System.Windows.Forms.Label();
     this.tabControlAdv3 = new Syncfusion.Windows.Forms.Tools.TabControlAdv();
     this.tabPageAdv5    = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
     this.label4         = new System.Windows.Forms.Label();
     this.tabPageAdv6    = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
     this.label8         = new System.Windows.Forms.Label();
     this.gridLayout1    = new Syncfusion.Windows.Forms.Tools.GridLayout(this.components);
     this.gridLayout2    = new Syncfusion.Windows.Forms.Tools.GridLayout(this.components);
     this.gridLayout3    = new Syncfusion.Windows.Forms.Tools.GridLayout(this.components);
     this.panel1.SuspendLayout();
     this.panel2.SuspendLayout();
     this.panel4.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.tabControlAdv2)).BeginInit();
     this.tabControlAdv2.SuspendLayout();
     this.tabPageAdv3.SuspendLayout();
     this.tabPageAdv4.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.tabControlAdv1)).BeginInit();
     this.tabControlAdv1.SuspendLayout();
     this.tabPageAdv1.SuspendLayout();
     this.tabPageAdv2.SuspendLayout();
     this.panel3.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.tabControlAdv4)).BeginInit();
     this.tabControlAdv4.SuspendLayout();
     this.tabPageAdv7.SuspendLayout();
     this.tabPageAdv8.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.tabControlAdv3)).BeginInit();
     this.tabControlAdv3.SuspendLayout();
     this.tabPageAdv5.SuspendLayout();
     this.tabPageAdv6.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.gridLayout1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridLayout2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridLayout3)).BeginInit();
     this.SuspendLayout();
     //
     // panel1
     //
     this.panel1.Controls.Add(this.checkBox1);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Right;
     this.panel1.Font     = new System.Drawing.Font("Microsoft Sans Serif", 8.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.panel1.Location = new System.Drawing.Point(1218, 2);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(264, 690);
     this.panel1.TabIndex = 0;
     //
     // checkBox1
     //
     this.checkBox1.AutoSize = true;
     this.checkBox1.Font     = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.checkBox1.Location = new System.Drawing.Point(2, 75);
     this.checkBox1.Name     = "checkBox1";
     this.checkBox1.Size     = new System.Drawing.Size(227, 24);
     this.checkBox1.TabIndex = 0;
     this.checkBox1.Text     = "Rotate Text When Vertical";
     this.checkBox1.UseVisualStyleBackColor = true;
     this.checkBox1.CheckedChanged         += new System.EventHandler(this.checkBox1_CheckedChanged);
     //
     // panel2
     //
     this.panel2.Controls.Add(this.panel4);
     this.panel2.Controls.Add(this.panel3);
     this.panel2.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panel2.Location = new System.Drawing.Point(2, 2);
     this.panel2.Name     = "panel2";
     this.panel2.Size     = new System.Drawing.Size(1216, 690);
     this.panel2.TabIndex = 1;
     //
     // panel4
     //
     this.panel4.Controls.Add(this.tabControlAdv2);
     this.panel4.Controls.Add(this.tabControlAdv1);
     this.panel4.Location = new System.Drawing.Point(0, 0);
     this.panel4.Name     = "panel4";
     this.gridLayout1.SetParticipateInLayout(this.panel4, true);
     this.panel4.Size     = new System.Drawing.Size(608, 690);
     this.panel4.TabIndex = 1;
     //
     // tabControlAdv2
     //
     this.tabControlAdv2.ActiveTabFont               = new System.Drawing.Font("Microsoft Sans Serif", 7.8F);
     this.tabControlAdv2.ActiveTabForeColor          = System.Drawing.Color.Empty;
     this.tabControlAdv2.BeforeTouchSize             = new System.Drawing.Size(533, 270);
     this.tabControlAdv2.CloseButtonForeColor        = System.Drawing.Color.Empty;
     this.tabControlAdv2.CloseButtonHoverForeColor   = System.Drawing.Color.Empty;
     this.tabControlAdv2.CloseButtonPressedForeColor = System.Drawing.Color.Empty;
     this.tabControlAdv2.Controls.Add(this.tabPageAdv3);
     this.tabControlAdv2.Controls.Add(this.tabPageAdv4);
     this.tabControlAdv2.InActiveTabForeColor = System.Drawing.Color.Empty;
     this.tabControlAdv2.Location             = new System.Drawing.Point(50, 50);
     this.tabControlAdv2.Name = "tabControlAdv2";
     this.gridLayout2.SetParticipateInLayout(this.tabControlAdv2, true);
     this.tabControlAdv2.SeparatorColor = System.Drawing.SystemColors.ControlDark;
     this.tabControlAdv2.ShowSeparator  = false;
     this.tabControlAdv2.Size           = new System.Drawing.Size(533, 270);
     this.tabControlAdv2.TabIndex       = 1;
     this.tabControlAdv2.TabStyle       = typeof(Syncfusion.Windows.Forms.Tools.TabRendererOffice2016Colorful);
     this.tabControlAdv2.ThemeName      = "TabRenderer3D";
     //
     // tabPageAdv3
     //
     this.tabPageAdv3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.tabPageAdv3.Controls.Add(this.label1);
     this.tabPageAdv3.ForeColor       = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(38)))), ((int)(((byte)(38)))));
     this.tabPageAdv3.Image           = null;
     this.tabPageAdv3.ImageSize       = new System.Drawing.Size(20, 20);
     this.tabPageAdv3.Location        = new System.Drawing.Point(1, 25);
     this.tabPageAdv3.Name            = "tabPageAdv3";
     this.tabPageAdv3.ShowCloseButton = true;
     this.tabPageAdv3.Size            = new System.Drawing.Size(530, 243);
     this.tabPageAdv3.TabIndex        = 1;
     this.tabPageAdv3.Text            = "Tab1";
     this.tabPageAdv3.ThemesEnabled   = false;
     //
     // label1
     //
     this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                 | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.label1.AutoSize  = true;
     this.label1.Location  = new System.Drawing.Point(123, 114);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(136, 17);
     this.label1.TabIndex  = 0;
     this.label1.Text      = "Tab Alignment : Top";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // tabPageAdv4
     //
     this.tabPageAdv4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.tabPageAdv4.Controls.Add(this.label5);
     this.tabPageAdv4.ForeColor       = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(38)))), ((int)(((byte)(38)))));
     this.tabPageAdv4.Image           = null;
     this.tabPageAdv4.ImageSize       = new System.Drawing.Size(20, 20);
     this.tabPageAdv4.Location        = new System.Drawing.Point(1, 25);
     this.tabPageAdv4.Name            = "tabPageAdv4";
     this.tabPageAdv4.ShowCloseButton = true;
     this.tabPageAdv4.Size            = new System.Drawing.Size(530, 243);
     this.tabPageAdv4.TabIndex        = 2;
     this.tabPageAdv4.Text            = "Tab2";
     this.tabPageAdv4.ThemesEnabled   = false;
     //
     // label5
     //
     this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                 | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.label5.AutoSize  = true;
     this.label5.Location  = new System.Drawing.Point(123, 113);
     this.label5.Name      = "label5";
     this.label5.Size      = new System.Drawing.Size(136, 17);
     this.label5.TabIndex  = 1;
     this.label5.Text      = "Tab Alignment : Top";
     this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // tabControlAdv1
     //
     this.tabControlAdv1.ActiveTabFont               = new System.Drawing.Font("Microsoft Sans Serif", 7.8F);
     this.tabControlAdv1.ActiveTabForeColor          = System.Drawing.Color.Empty;
     this.tabControlAdv1.Alignment                   = System.Windows.Forms.TabAlignment.Bottom;
     this.tabControlAdv1.BeforeTouchSize             = new System.Drawing.Size(533, 270);
     this.tabControlAdv1.CloseButtonForeColor        = System.Drawing.Color.Empty;
     this.tabControlAdv1.CloseButtonHoverForeColor   = System.Drawing.Color.Empty;
     this.tabControlAdv1.CloseButtonPressedForeColor = System.Drawing.Color.Empty;
     this.tabControlAdv1.Controls.Add(this.tabPageAdv1);
     this.tabControlAdv1.Controls.Add(this.tabPageAdv2);
     this.tabControlAdv1.InActiveTabForeColor = System.Drawing.Color.Empty;
     this.tabControlAdv1.Location             = new System.Drawing.Point(50, 370);
     this.tabControlAdv1.Name = "tabControlAdv1";
     this.gridLayout2.SetParticipateInLayout(this.tabControlAdv1, true);
     this.tabControlAdv1.SeparatorColor = System.Drawing.SystemColors.ControlDark;
     this.tabControlAdv1.ShowSeparator  = false;
     this.tabControlAdv1.Size           = new System.Drawing.Size(533, 270);
     this.tabControlAdv1.TabIndex       = 0;
     this.tabControlAdv1.TabStyle       = typeof(Syncfusion.Windows.Forms.Tools.TabRendererOffice2016Colorful);
     this.tabControlAdv1.ThemeName      = "TabRenderer3D";
     //
     // tabPageAdv1
     //
     this.tabPageAdv1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.tabPageAdv1.Controls.Add(this.label2);
     this.tabPageAdv1.ForeColor       = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(38)))), ((int)(((byte)(38)))));
     this.tabPageAdv1.Image           = null;
     this.tabPageAdv1.ImageSize       = new System.Drawing.Size(20, 20);
     this.tabPageAdv1.Location        = new System.Drawing.Point(1, 2);
     this.tabPageAdv1.Name            = "tabPageAdv1";
     this.tabPageAdv1.ShowCloseButton = true;
     this.tabPageAdv1.Size            = new System.Drawing.Size(530, 243);
     this.tabPageAdv1.TabIndex        = 1;
     this.tabPageAdv1.Text            = "Tab1";
     this.tabPageAdv1.ThemesEnabled   = false;
     //
     // label2
     //
     this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                 | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.label2.AutoSize = true;
     this.label2.Location = new System.Drawing.Point(123, 113);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(155, 17);
     this.label2.TabIndex = 1;
     this.label2.Text     = "Tab Alignment : Bottom";
     //
     // tabPageAdv2
     //
     this.tabPageAdv2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.tabPageAdv2.Controls.Add(this.label6);
     this.tabPageAdv2.ForeColor       = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(38)))), ((int)(((byte)(38)))));
     this.tabPageAdv2.Image           = null;
     this.tabPageAdv2.ImageSize       = new System.Drawing.Size(20, 20);
     this.tabPageAdv2.Location        = new System.Drawing.Point(1, 2);
     this.tabPageAdv2.Name            = "tabPageAdv2";
     this.tabPageAdv2.ShowCloseButton = true;
     this.tabPageAdv2.Size            = new System.Drawing.Size(530, 243);
     this.tabPageAdv2.TabIndex        = 2;
     this.tabPageAdv2.Text            = "Tab2";
     this.tabPageAdv2.ThemesEnabled   = false;
     //
     // label6
     //
     this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                 | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.label6.AutoSize = true;
     this.label6.Location = new System.Drawing.Point(123, 113);
     this.label6.Name     = "label6";
     this.label6.Size     = new System.Drawing.Size(155, 17);
     this.label6.TabIndex = 2;
     this.label6.Text     = "Tab Alignment : Bottom";
     //
     // panel3
     //
     this.panel3.Controls.Add(this.tabControlAdv4);
     this.panel3.Controls.Add(this.tabControlAdv3);
     this.panel3.Location = new System.Drawing.Point(608, 0);
     this.panel3.Name     = "panel3";
     this.gridLayout1.SetParticipateInLayout(this.panel3, true);
     this.panel3.Size     = new System.Drawing.Size(608, 690);
     this.panel3.TabIndex = 0;
     //
     // tabControlAdv4
     //
     this.tabControlAdv4.ActiveTabFont               = new System.Drawing.Font("Microsoft Sans Serif", 7.8F);
     this.tabControlAdv4.ActiveTabForeColor          = System.Drawing.Color.Empty;
     this.tabControlAdv4.Alignment                   = System.Windows.Forms.TabAlignment.Left;
     this.tabControlAdv4.BeforeTouchSize             = new System.Drawing.Size(241, 590);
     this.tabControlAdv4.CloseButtonForeColor        = System.Drawing.Color.Empty;
     this.tabControlAdv4.CloseButtonHoverForeColor   = System.Drawing.Color.Empty;
     this.tabControlAdv4.CloseButtonPressedForeColor = System.Drawing.Color.Empty;
     this.tabControlAdv4.Controls.Add(this.tabPageAdv7);
     this.tabControlAdv4.Controls.Add(this.tabPageAdv8);
     this.tabControlAdv4.InActiveTabForeColor = System.Drawing.Color.Empty;
     this.tabControlAdv4.Location             = new System.Drawing.Point(26, 50);
     this.tabControlAdv4.Name = "tabControlAdv4";
     this.gridLayout3.SetParticipateInLayout(this.tabControlAdv4, true);
     this.tabControlAdv4.SeparatorColor = System.Drawing.SystemColors.ControlDark;
     this.tabControlAdv4.ShowSeparator  = false;
     this.tabControlAdv4.Size           = new System.Drawing.Size(241, 590);
     this.tabControlAdv4.TabIndex       = 2;
     this.tabControlAdv4.TabStyle       = typeof(Syncfusion.Windows.Forms.Tools.TabRendererOffice2016Colorful);
     this.tabControlAdv4.ThemeName      = "TabRenderer3D";
     //
     // tabPageAdv7
     //
     this.tabPageAdv7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.tabPageAdv7.Controls.Add(this.label3);
     this.tabPageAdv7.ForeColor       = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(38)))), ((int)(((byte)(38)))));
     this.tabPageAdv7.Image           = null;
     this.tabPageAdv7.ImageSize       = new System.Drawing.Size(20, 20);
     this.tabPageAdv7.Location        = new System.Drawing.Point(27, 1);
     this.tabPageAdv7.Name            = "tabPageAdv7";
     this.tabPageAdv7.ShowCloseButton = true;
     this.tabPageAdv7.Size            = new System.Drawing.Size(213, 587);
     this.tabPageAdv7.TabIndex        = 1;
     this.tabPageAdv7.Text            = "Tab1";
     this.tabPageAdv7.ThemesEnabled   = false;
     //
     // label3
     //
     this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                 | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.label3.AutoSize = true;
     this.label3.Location = new System.Drawing.Point(16, 285);
     this.label3.Name     = "label3";
     this.label3.Size     = new System.Drawing.Size(135, 17);
     this.label3.TabIndex = 2;
     this.label3.Text     = "Tab Alignment : Left";
     //
     // tabPageAdv8
     //
     this.tabPageAdv8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.tabPageAdv8.Controls.Add(this.label7);
     this.tabPageAdv8.ForeColor       = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(38)))), ((int)(((byte)(38)))));
     this.tabPageAdv8.Image           = null;
     this.tabPageAdv8.ImageSize       = new System.Drawing.Size(20, 20);
     this.tabPageAdv8.Location        = new System.Drawing.Point(27, 1);
     this.tabPageAdv8.Name            = "tabPageAdv8";
     this.tabPageAdv8.ShowCloseButton = true;
     this.tabPageAdv8.Size            = new System.Drawing.Size(213, 587);
     this.tabPageAdv8.TabIndex        = 2;
     this.tabPageAdv8.Text            = "Tab2";
     this.tabPageAdv8.ThemesEnabled   = false;
     //
     // label7
     //
     this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                 | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.label7.AutoSize = true;
     this.label7.Location = new System.Drawing.Point(16, 285);
     this.label7.Name     = "label7";
     this.label7.Size     = new System.Drawing.Size(135, 17);
     this.label7.TabIndex = 3;
     this.label7.Text     = "Tab Alignment : Left";
     //
     // tabControlAdv3
     //
     this.tabControlAdv3.ActiveTabFont               = new System.Drawing.Font("Microsoft Sans Serif", 7.8F);
     this.tabControlAdv3.ActiveTabForeColor          = System.Drawing.Color.Empty;
     this.tabControlAdv3.Alignment                   = System.Windows.Forms.TabAlignment.Right;
     this.tabControlAdv3.BeforeTouchSize             = new System.Drawing.Size(241, 590);
     this.tabControlAdv3.CloseButtonForeColor        = System.Drawing.Color.Empty;
     this.tabControlAdv3.CloseButtonHoverForeColor   = System.Drawing.Color.Empty;
     this.tabControlAdv3.CloseButtonPressedForeColor = System.Drawing.Color.Empty;
     this.tabControlAdv3.Controls.Add(this.tabPageAdv5);
     this.tabControlAdv3.Controls.Add(this.tabPageAdv6);
     this.tabControlAdv3.InActiveTabForeColor = System.Drawing.Color.Empty;
     this.tabControlAdv3.Location             = new System.Drawing.Point(317, 50);
     this.tabControlAdv3.Name = "tabControlAdv3";
     this.gridLayout3.SetParticipateInLayout(this.tabControlAdv3, true);
     this.tabControlAdv3.SeparatorColor = System.Drawing.SystemColors.ControlDark;
     this.tabControlAdv3.ShowSeparator  = false;
     this.tabControlAdv3.Size           = new System.Drawing.Size(241, 590);
     this.tabControlAdv3.TabIndex       = 1;
     this.tabControlAdv3.TabStyle       = typeof(Syncfusion.Windows.Forms.Tools.TabRendererOffice2016Colorful);
     this.tabControlAdv3.ThemeName      = "TabRenderer3D";
     //
     // tabPageAdv5
     //
     this.tabPageAdv5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.tabPageAdv5.Controls.Add(this.label4);
     this.tabPageAdv5.ForeColor       = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(38)))), ((int)(((byte)(38)))));
     this.tabPageAdv5.Image           = null;
     this.tabPageAdv5.ImageSize       = new System.Drawing.Size(20, 20);
     this.tabPageAdv5.Location        = new System.Drawing.Point(2, 1);
     this.tabPageAdv5.Name            = "tabPageAdv5";
     this.tabPageAdv5.ShowCloseButton = true;
     this.tabPageAdv5.Size            = new System.Drawing.Size(213, 587);
     this.tabPageAdv5.TabIndex        = 1;
     this.tabPageAdv5.Text            = "Tab1";
     this.tabPageAdv5.ThemesEnabled   = false;
     //
     // label4
     //
     this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                 | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.label4.AutoSize = true;
     this.label4.Location = new System.Drawing.Point(12, 285);
     this.label4.Name     = "label4";
     this.label4.Size     = new System.Drawing.Size(144, 17);
     this.label4.TabIndex = 2;
     this.label4.Text     = "Tab Alignment : Right";
     //
     // tabPageAdv6
     //
     this.tabPageAdv6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.tabPageAdv6.Controls.Add(this.label8);
     this.tabPageAdv6.ForeColor       = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(38)))), ((int)(((byte)(38)))));
     this.tabPageAdv6.Image           = null;
     this.tabPageAdv6.ImageSize       = new System.Drawing.Size(20, 20);
     this.tabPageAdv6.Location        = new System.Drawing.Point(2, 1);
     this.tabPageAdv6.Name            = "tabPageAdv6";
     this.tabPageAdv6.ShowCloseButton = true;
     this.tabPageAdv6.Size            = new System.Drawing.Size(213, 587);
     this.tabPageAdv6.TabIndex        = 2;
     this.tabPageAdv6.Text            = "Tab2";
     this.tabPageAdv6.ThemesEnabled   = false;
     //
     // label8
     //
     this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                 | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.label8.AutoSize = true;
     this.label8.Location = new System.Drawing.Point(12, 285);
     this.label8.Name     = "label8";
     this.label8.Size     = new System.Drawing.Size(144, 17);
     this.label8.TabIndex = 3;
     this.label8.Text     = "Tab Alignment : Right";
     //
     // gridLayout1
     //
     this.gridLayout1.Columns          = 2;
     this.gridLayout1.ContainerControl = this.panel2;
     this.gridLayout1.Rows             = 1;
     //
     // gridLayout2
     //
     this.gridLayout2.BottomMargin     = 50;
     this.gridLayout2.Columns          = 1;
     this.gridLayout2.ContainerControl = this.panel4;
     this.gridLayout2.HGap             = 50;
     this.gridLayout2.HorzFarMargin    = 25;
     this.gridLayout2.HorzNearMargin   = 50;
     this.gridLayout2.Rows             = 2;
     this.gridLayout2.TopMargin        = 50;
     this.gridLayout2.VGap             = 50;
     //
     // gridLayout3
     //
     this.gridLayout3.BottomMargin     = 50;
     this.gridLayout3.Columns          = 2;
     this.gridLayout3.ContainerControl = this.panel3;
     this.gridLayout3.HGap             = 50;
     this.gridLayout3.HorzFarMargin    = 50;
     this.gridLayout3.HorzNearMargin   = 25;
     this.gridLayout3.Rows             = 1;
     this.gridLayout3.TopMargin        = 50;
     //
     // TabAlignmentFrame
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(1484, 694);
     this.Controls.Add(this.panel2);
     this.Controls.Add(this.panel1);
     this.MaximizeBox   = false;
     this.MaximumSize   = new System.Drawing.Size(1500, 733);
     this.MinimumSize   = new System.Drawing.Size(1500, 733);
     this.Name          = "TabAlignmentFrame";
     this.Text          = "Tab Alignment";
     this.StartPosition = FormStartPosition.CenterScreen;
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     this.panel2.ResumeLayout(false);
     this.panel4.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.tabControlAdv2)).EndInit();
     this.tabControlAdv2.ResumeLayout(false);
     this.tabPageAdv3.ResumeLayout(false);
     this.tabPageAdv3.PerformLayout();
     this.tabPageAdv4.ResumeLayout(false);
     this.tabPageAdv4.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.tabControlAdv1)).EndInit();
     this.tabControlAdv1.ResumeLayout(false);
     this.tabPageAdv1.ResumeLayout(false);
     this.tabPageAdv1.PerformLayout();
     this.tabPageAdv2.ResumeLayout(false);
     this.tabPageAdv2.PerformLayout();
     this.panel3.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.tabControlAdv4)).EndInit();
     this.tabControlAdv4.ResumeLayout(false);
     this.tabPageAdv7.ResumeLayout(false);
     this.tabPageAdv7.PerformLayout();
     this.tabPageAdv8.ResumeLayout(false);
     this.tabPageAdv8.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.tabControlAdv3)).EndInit();
     this.tabControlAdv3.ResumeLayout(false);
     this.tabPageAdv5.ResumeLayout(false);
     this.tabPageAdv5.PerformLayout();
     this.tabPageAdv6.ResumeLayout(false);
     this.tabPageAdv6.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.gridLayout1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridLayout2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridLayout3)).EndInit();
     this.ResumeLayout(false);
 }
예제 #59
0
파일: Program.cs 프로젝트: xorkrus/vk_wm
        /// <summary>
        /// Отображение уведомления
        /// </summary>
        /// <param name="aText">Текст для отображения</param>
        /// <param name="aSilent">Иконка</param>
        /// <param name="aStraightToTray">Silent режим</param>
        static void OnNotificationShow(string aText, System.Drawing.Icon aIcon, bool aSilent)
        {
            DebugHelper.WriteLogEntry("OnNotificationShow " + aText + aSilent);

            _notification.Caption        = Properties.Resources.Program_OnNtfnShow_Caption;
            _notification.Text           = aText;
            _notification.Icon           = aIcon;
            _notification.StraightToTray = aSilent;
            _notification.Silent         = true;
            _notification.DisplayOn      = !aSilent;
            _notification.Visible        = true;

            //Get info from the registry about the notification type and the options
            DebugHelper.WriteLogEntry("OnNotificationShow NotificationClass.Get");
            var nc = NotificationClass.Get(NotificationCLSID);

            //Application.DoEvents();

            DebugHelper.WriteLogEntry("OnNotificationShow Vibrate");
            if (!aSilent)
            {
                #region vibrate if need
                if ((nc.Options & NotificationOptions.Vibrate) > 0)
                {
                    try
                    {
                        VibrateLED.Vibrate();
                    }
                    catch (Exception ex)
                    {
                        DebugHelper.WriteLogEntry(ex, "Vibrate error");
                    }
                }
                #endregion

                DebugHelper.WriteLogEntry("OnNotificationShow Sound");

                #region play music if need
                try
                {
                    if ((nc.Options & NotificationOptions.Sound) > 0)
                    {
                        if (!String.IsNullOrEmpty(nc.WaveFile))
                        {
                            if (PlatformDetection.IsWM5())
                            {
                                WCE_PlaySound(nc.WaveFile, IntPtr.Zero, (int)(Flags.SND_FILENAME | Flags.SND_ASYNC));
                            }
                            else
                            {
                                string ext = null;
                                try
                                {
                                    ext = Path.GetExtension(nc.WaveFile);
                                }
                                catch (ArgumentException)
                                {
                                }

                                int esuccess = 0;
                                switch (ext)
                                {
                                //case ".wav":
                                //    esuccess = WCE_PlaySound(nc.WaveFile, IntPtr.Zero, (int)(Flags.SND_FILENAME | Flags.SND_ASYNC));
                                //    break;
                                case ".wav":
                                case ".mp3":
                                case ".wma":
                                case ".mid":
                                case ".midi":
                                    //Application.DoEvents();
                                    using (SoundPlayer player = new SoundPlayer(nc.WaveFile))
                                    {
                                        player.Play();
                                        esuccess = 1;
                                    }
                                    break;
                                }

                                if (esuccess == 0)
                                {
                                    //WCE_PlaySound("Default", IntPtr.Zero, (int)(Flags.SND_ALIAS_ID | Flags.SND_ASYNC));
                                    WCE_PlaySound("\\Windows\\asterisk.wav", IntPtr.Zero, (int)(Flags.SND_FILENAME | Flags.SND_ASYNC));
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    DebugHelper.WriteLogEntry(ex, "Play sound error");
                }

                #endregion
            }
            DebugHelper.WriteLogEntry("OnNotificationShow End");
        }
예제 #60
0
 public static BitmapSource ToBitmapSource(this System.Drawing.Icon icon)
 {
     return(icon.ToBitmap().ToBitmapSource());
 }