コード例 #1
0
 public Engine(EngineParameters userParams)
 {
     if (userParams.CrossoverRate.HasValue)
     {
         CrossoverRate = userParams.CrossoverRate.Value;
     }
     if (userParams.ElitismRate.HasValue)
     {
         ElitismRate = userParams.ElitismRate.Value;
     }
     if (userParams.IsLowerFitnessBetter.HasValue)
     {
         IsLowerFitnessBetter = userParams.IsLowerFitnessBetter.Value;
     }
     if (userParams.MaxGenerations.HasValue)
     {
         MaxGenerations = userParams.MaxGenerations.Value;
     }
     if (userParams.MinGenerations.HasValue)
     {
         MinGenerations = userParams.MinGenerations.Value;
     }
     if (userParams.MutationRate.HasValue)
     {
         MutationRate = userParams.MutationRate.Value;
     }
     if (userParams.StagnantGenerationLimit.HasValue)
     {
         StagnantGenerationLimit = userParams.StagnantGenerationLimit.Value;
     }
     if (userParams.PopulationSize.HasValue)
     {
         PopulationSize = userParams.PopulationSize.Value;
     }
     if (userParams.RandomTreeMaxDepth.HasValue)
     {
         RandomTreeMaxDepth = userParams.RandomTreeMaxDepth.Value;
     }
     if (userParams.RandomTreeMinDepth.HasValue)
     {
         RandomTreeMinDepth = userParams.RandomTreeMinDepth.Value;
     }
     if (userParams.TourneySize.HasValue)
     {
         TourneySize = userParams.TourneySize.Value;
     }
     if (userParams.SelectionStyle.HasValue)
     {
         SelectionStyle = userParams.SelectionStyle.Value;
     }
 }
コード例 #2
0
        public override void loadFrom(BinaryReader reader, PersistContext ctx)
        {
            base.loadFrom(reader, ctx);
            ctx.loadReference(this);
            ctx.loadReference(this);
            ctx.loadReference(this);
            ctx.loadReference(this);
            style = (SelectionStyle)reader.ReadInt32();

            if (ctx.FileVersion >= 12)
            {
                // new in file format 12
                ctx.loadReference(this);                        // selectedHosts
            }
        }
コード例 #3
0
        public Schedule()
        {
            InitializeComponent();
            //schedule.ScheduleView = ScheduleView.WorkWeekView;
            ////Create new instance of WorkWeekViewSettings
            //WorkWeekViewSettings workWeekViewSettings = new WorkWeekViewSettings();
            //workWeekViewSettings.TimeSlotBorderColor = Color.Aqua;
            //workWeekViewSettings.VerticalLineColor = Color.Blue;
            //workWeekViewSettings.TimeSlotColor = Color.Yellow;
            //workWeekViewSettings.TimeSlotBorderStrokeWidth = 5;
            //workWeekViewSettings.VerticalLineStrokeWidth = 5;
            //schedule.WorkWeekViewSettings = workWeekViewSettings;

            schedule.ScheduleView = ScheduleView.WorkWeekView;

            //Create new instance of NonAccessibleBlock
            NonAccessibleBlock nonAccessibleBlock = new NonAccessibleBlock();
            //Create new instance of NonAccessibleBlocksCollection
            NonAccessibleBlocksCollection nonAccessibleBlocksCollection = new NonAccessibleBlocksCollection();
            WorkWeekViewSettings          workWeekViewSettings          = new WorkWeekViewSettings();

            nonAccessibleBlock.StartTime = 13;
            nonAccessibleBlock.EndTime   = 14;
            nonAccessibleBlock.Text      = "LUNCH";
            nonAccessibleBlock.Color     = Color.GreenYellow;
            nonAccessibleBlocksCollection.Add(nonAccessibleBlock);
            workWeekViewSettings.NonAccessibleBlocks = nonAccessibleBlocksCollection;

            //Create new instance of SelectionStyle
            SelectionStyle selectionStyle = new SelectionStyle();

            selectionStyle.BackgroundColor    = Color.Red;
            selectionStyle.BorderColor        = Color.Black;
            selectionStyle.BorderThickness    = 5;
            selectionStyle.BorderCornerRadius = 5;
            schedule.SelectionStyle           = selectionStyle;
        }
コード例 #4
0
ファイル: Selection.cs プロジェクト: ChrisMoreton/Test3
		public override void loadFrom(BinaryReader reader, PersistContext ctx)
		{
			base.loadFrom(reader, ctx);
			ctx.loadReference(this);
			ctx.loadReference(this);
			ctx.loadReference(this);
			ctx.loadReference(this);
			style = (SelectionStyle)reader.ReadInt32();

			if (ctx.FileVersion >= 12)
			{
				// new in file format 12
				ctx.loadReference(this);	// selectedHosts
			}
		}
コード例 #5
0
ファイル: Table.cs プロジェクト: nithinphilips/SMOz
		/*/// <summary>
		/// Specifies whether pressing the Tab key while editing moves the 
		/// editor to the next available cell
		/// </summary>
		private bool tabMovesEditor;*/

		#endregion

		#endregion


		#region Constructor

		/// <summary>
		/// Initializes a new instance of the Table class with default settings
		/// </summary>
		public Table()
		{
			// starting setup
			this.init = true;
			
			// This call is required by the Windows.Forms Form Designer.
			components = new System.ComponentModel.Container();

			//
			this.SetStyle(ControlStyles.UserPaint, true);
			this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
			this.SetStyle(ControlStyles.DoubleBuffer, true);
			this.SetStyle(ControlStyles.ResizeRedraw, true);
			this.SetStyle(ControlStyles.Selectable, true);
			this.TabStop = true;

			this.Size = new Size(150, 150);

			this.BackColor = Color.White;

			//
			this.columnModel = null;
			this.tableModel = null;

			// header
			this.headerStyle = ColumnHeaderStyle.Clickable;
			this.headerFont = this.Font;
			this.headerRenderer = new XPHeaderRenderer();
			//this.headerRenderer = new GradientHeaderRenderer();
			//this.headerRenderer = new FlatHeaderRenderer();
			this.headerRenderer.Font = this.headerFont;
			this.headerContextMenu = new HeaderContextMenu();
			
			this.columnResizing = true;
			this.resizingColumnIndex = -1;
			this.resizingColumnWidth = -1;
			this.hotColumn = -1;
			this.pressedColumn = -1;
			this.lastSortedColumn = -1;
			this.sortedColumnBackColor = Color.WhiteSmoke;

			// borders
			this.borderStyle = BorderStyle.Fixed3D;

			// scrolling
			this.scrollable = true;

			this.hScrollBar = new HScrollBar();
			this.hScrollBar.Visible = false;
			this.hScrollBar.Location = new Point(this.BorderWidth, this.Height - this.BorderWidth - SystemInformation.HorizontalScrollBarHeight);
			this.hScrollBar.Width = this.Width - (this.BorderWidth * 2) - SystemInformation.VerticalScrollBarWidth;
			this.hScrollBar.Scroll += new ScrollEventHandler(this.OnHorizontalScroll);
			this.Controls.Add(this.hScrollBar);

			this.vScrollBar = new VScrollBar();
			this.vScrollBar.Visible = false;
			this.vScrollBar.Location = new Point(this.Width - this.BorderWidth - SystemInformation.VerticalScrollBarWidth, this.BorderWidth);
			this.vScrollBar.Height = this.Height - (this.BorderWidth * 2) - SystemInformation.HorizontalScrollBarHeight;
			this.vScrollBar.Scroll += new ScrollEventHandler(this.OnVerticalScroll);
			this.Controls.Add(this.vScrollBar);

			//
			this.gridLines = GridLines.None;;
			this.gridColor = SystemColors.Control;
			this.gridLineStyle = GridLineStyle.Solid;

			this.allowSelection = true;
			this.multiSelect = false;
			this.fullRowSelect = false;
			this.hideSelection = false;
			this.selectionBackColor = SystemColors.Highlight;
			this.selectionForeColor = SystemColors.HighlightText;
			this.unfocusedSelectionBackColor = SystemColors.Control;
			this.unfocusedSelectionForeColor = SystemColors.ControlText;
			this.selectionStyle = SelectionStyle.ListView;
			this.alternatingRowColor = Color.Transparent;

			// current table state
			this.tableState = TableState.Normal;

			this.lastMouseCell = new CellPos(-1, -1);
			this.lastMouseDownCell = new CellPos(-1, -1);
			this.focusedCell = new CellPos(-1, -1);
			this.hoverTime = 1000;
			this.trackMouseEvent = null;
			this.ResetMouseEventArgs();

			this.toolTip = new ToolTip(this.components);
			this.toolTip.Active = false;
			this.toolTip.InitialDelay = 1000;

			this.noItemsText = "There are no items in this view";

			this.editingCell = new CellPos(-1, -1);
			this.curentCellEditor = null;
			this.editStartAction = EditStartAction.DoubleClick;
			this.customEditKey = Keys.F5;
			//this.tabMovesEditor = true;

			// finished setting up
			this.beginUpdateCount = 0;
			this.init = false;
			this.preview = false;
		}
コード例 #6
0
 public abstract void DrawSelectionBox(GuiRenderer renderer, Rectangle bounds, SelectionStyle selectionStyle);
コード例 #7
0
        public override void DrawSelectionBox(GuiRenderer renderer, Rectangle bounds, SelectionStyle selectionStyle)
        {
            var color = _selectionColor;

            if (selectionStyle == SelectionStyle.ItemHover)
            {
                color *= 0.67f;
            }

            renderer.FillRectangle(bounds, color);
        }
コード例 #8
0
ファイル: KNTableView.cs プロジェクト: iKenndac/KNControlsWPF
 public KNTableViewRowSelectionLayer()
 {
     style = KNTableView.SelectionStyle.WindowsExplorer;
     this.AddObserverToKeyPathWithOptions(this, "SelectionStyle", 0, null);
     this.AddObserverToKeyPathWithOptions(this, "ContentStart", 0, null);
     this.AddObserverToKeyPathWithOptions(this, "ContentLength", 0, null);
 }