예제 #1
0
		/// <summary>
		/// Creates new instance of side bar control.
		/// </summary>
		public ExplorerBar()
		{
			if(!ColorFunctions.ColorsLoaded)
			{
				NativeFunctions.RefreshSettings();
				NativeFunctions.OnDisplayChange();
				ColorFunctions.LoadColors();
			}
			m_ColorScheme=new ColorScheme(eDotNetBarStyle.Office2003);

			m_ItemContainer=new ExplorerBarContainerItem();
			m_ItemContainer.GlobalItem=false;
			m_ItemContainer.ContainerControl=this;
			m_ItemContainer.Stretch=false;
			m_ItemContainer.Displayed=true;
			m_ItemContainer.SetOwner(this);

			//this.SetStyle(ControlStyles.Selectable,false);
			this.SetStyle(ControlStyles.UserPaint,true);
			this.SetStyle(ControlStyles.AllPaintingInWmPaint,true);
			this.SetStyle(ControlStyles.Opaque,true);
			this.SetStyle(ControlStyles.ResizeRedraw,true);
			this.SetStyle(DisplayHelp.DoubleBufferFlag,true);
			this.SetStyle(ControlStyles.ContainerControl,true);
			this.SetStyle(ControlStyles.SupportsTransparentBackColor,true);

			this.TabStop=true;

			#if TRIAL
				RemindForm frm=new RemindForm();
				frm.ShowDialog();
			#endif

			try
			{
				m_MoveCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGMOVE.CUR");
				m_CopyCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGCOPY.CUR");
				m_NACursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGNONE.CUR");
			}
			catch(Exception)
			{
				m_MoveCursor=null;
				m_CopyCursor=null;
				m_NACursor=null;
			}

			ApplyDefaultSettings();
			m_BackStyle.StyleChanged+=new EventHandler(this.VisualPropertyChanged);

			this.AccessibleRole=AccessibleRole.ToolBar;

            m_BackgroundStyle = new ItemStyleMapper(m_BackStyle);
		}
예제 #2
0
        protected override void OnVisibleChanged(EventArgs e)
        {
            if (!this.Visible)
                OnActiveWindowChanged();
            else
            {
#if TRIAL
                if(!this.DesignMode && !_ShownOnce)
                {
				    RemindForm frm=new RemindForm();
				    frm.ShowDialog();
				    frm.Dispose();
                    _ShownOnce = true;
                }
#endif

            }
            base.OnVisibleChanged(e);
        }
예제 #3
0
		void IOwnerMenuSupport.InvokePopupClose(PopupItem item,EventArgs e)
		{
			if(PopupClose!=null)
				PopupClose(item,e);
			#if TRIAL
			if(iCount>iMaxCount || iMaxCount<=0)
			{
				iCount=0;
				RemindForm f=new RemindForm();
				f.ShowDialog();
			}
			#endif
		}
예제 #4
0
		/// <summary>
		/// Creates new instance of DotNetBarManager.
		/// </summary>
		/// <param name="cont">Container.</param>
		public DotNetBarManager(IContainer cont)
		{
			#if TRIAL
				RemindForm frm=new RemindForm();
				frm.ShowDialog();
				frm.Dispose();
			#endif
            //#if !DEBUG
            //    m_License = LicenseManager.Validate(typeof(DotNetBarManager), this);
            //#endif
			//#endif

			InitializeComponent(cont);
		}
예제 #5
0
		public override License GetLicense(LicenseContext context,Type type,object instance,bool allowExceptions)
		{
			DevCoLicense lic = null;
			Debug.Assert(context!=null, "No context provided!");
			#if !TRIAL
			//if no context is provided, do nothing
			if (context != null) 
			{
				//if this control is in runtime mode
				if (context.UsageMode == LicenseUsageMode.Runtime) 
				{
					//retreive the stored license key
					string key = context.GetSavedLicenseKey(type, null);
					//check if the stored license key is null
					// and call IsKeyValid to make sure its valid
					if (key != null && IsKeyValid2(key, type)) 
					{
						//if the key is valid create a new license
						lic = new DevCoLicense(key);
					}
					else
					{
						try
						{
							System.Reflection.Assembly[] assemblies=System.AppDomain.CurrentDomain.GetAssemblies();
							foreach(System.Reflection.Assembly a in assemblies)
							{
								string codeBase = a.CodeBase;
								codeBase = codeBase.Substring(codeBase.LastIndexOf("/") + 1)+".licenses";
								System.IO.Stream stream=this.GetManifestResourceStream(a,codeBase);
								if(stream==null)
									codeBase=codeBase.Replace(".DLL.",".dll.");
								stream=this.GetManifestResourceStream(a,codeBase);
								if(stream!=null)
								{
									key=DeserializeLicenseKey(stream);
									if (key != null && key!="") //IsKeyValid2(key, type)) 
									{
										lic = new DevCoLicense(key);
										break;
									}
								}
							}
						}
						catch
						{
							lic=new DevCoLicense("");
						}
					}
				}
				else
				{
					string sKey="";
					Microsoft.Win32.RegistryKey regkey=Microsoft.Win32.Registry.LocalMachine;
					regkey=regkey.OpenSubKey("Software\\DevComponents\\Licenses",false);
					if(regkey!=null)
					{
						sKey=regkey.GetValue("DevComponents.DotNetBar.DotNetBarManager2").ToString();
					}
					//check if the key is valid
					if (IsKeyValid(sKey, type)) 
					{
						//valid key so create a new License
						lic = new DevCoLicense(Key(type));
					}

					//if we managed to create a license, stuff it into the context
					if (lic != null) 
					{
						context.SetSavedLicenseKey(type, lic.LicenseKey);
					}
				}
			}
			#else
			if (context != null) 
			{
				lic=new DevCoLicense("");
				//if this control is in runtime mode
				if (context.UsageMode == LicenseUsageMode.Runtime) 
				{
					RemindForm frm=new RemindForm();
					frm.ShowDialog();
				}
				else
				{
					context.SetSavedLicenseKey(type, lic.LicenseKey);
				}
			}
			#endif

			if(lic==null && context!=null)
			{
				RemindForm frm=new RemindForm();
				frm.ShowDialog();
				lic=new DevCoLicense("");
			}
			return lic;
			
		}
예제 #6
0
		protected override void OnHandleCreated(EventArgs e)
		{
			base.OnHandleCreated(e);

			RemindForm frm=new RemindForm();
			frm.ShowDialog();
			frm.Dispose();
		}
예제 #7
0
		/// <summary>
		/// Creates new instance of side bar control.
		/// </summary>
		public SideBar()
		{
			m_ItemContainer=new SideBarContainerItem();
			m_ItemContainer.GlobalItem=false;
			m_ItemContainer.ContainerControl=this;
			m_ItemContainer.Stretch=false;
			m_ItemContainer.Displayed=true;
			m_ItemContainer.SetOwner(this);

			//this.SetStyle(ControlStyles.Selectable,false);
			this.SetStyle(ControlStyles.UserPaint,true);
			this.SetStyle(ControlStyles.AllPaintingInWmPaint,true);
			this.SetStyle(ControlStyles.Opaque,true);
			this.SetStyle(ControlStyles.ResizeRedraw,true);
			this.SetStyle(DisplayHelp.DoubleBufferFlag,true);

			//this.TabStop=false;
			//this.Font=System.Windows.Forms.SystemInformation.MenuFont.Clone() as Font;

			if(!ColorFunctions.ColorsLoaded)
			{
				NativeFunctions.RefreshSettings();
				NativeFunctions.OnDisplayChange();
				ColorFunctions.LoadColors();
			}

			#if TRIAL
				RemindForm frm=new RemindForm();
				frm.ShowDialog();
			#endif

			try
			{
				m_MoveCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGMOVE.CUR");
				m_CopyCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGCOPY.CUR");
				m_NACursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGNONE.CUR");
			}
			catch(Exception)
			{
				m_MoveCursor=null;
				m_CopyCursor=null;
				m_NACursor=null;
			}
			this.AccessibleRole=AccessibleRole.ToolBar;

			m_ColorScheme=new ColorScheme();
            StyleManager.Register(this);
		}