public void Widgets_in_database_are_produced_by_factory()
        {
            var conventions = new DocumentConvention
            {
                FindTypeTagName = type =>
                                  {
                                      if (typeof(Widget).IsAssignableFrom(type))
                                      {
                                          return Widget.IdPrefix.TrimSuffix("/");
                                      }
                                      return DocumentConvention.DefaultTypeTagName(type);
                                  }
            };

            var testableStore = new TestableStore(conventions);

            var fooWidget = new CustomWidget { Markup = "foo" };
            var barWidget = new CustomWidget { Markup = "bar" };

            using (var session = testableStore.OpenSession())
            {
                session.Store(fooWidget);
                session.Store(barWidget);
                session.SaveChanges();

                var widgetFactory = new WidgetFactory(session);
                var widgets = widgetFactory.GetWidgets();

                Assert.Contains(fooWidget, widgets);
                Assert.Contains(barWidget, widgets);
            }
        }
    public ScrollListWidget(
        WidgetGroup parentGroup, 
        WidgetFactory widgetFactory,
        ScrollListStyle style,
        float x, 
        float y)
        : base(parentGroup, style.Width, style.Height, x, y)
    {
        m_widgetFactory = widgetFactory;
        m_widgetList = new List<IWidget>();
        m_scrollIndex = 0;

        m_scrollFrame = new ImageWidget(this, style.Width, style.Height, style.Background, 0.0f, 0.0f);

        m_scrollUpButton =
            new ButtonWidget(this, style.ButtonStyle, 0, 0, "Previous");
        m_scrollUpButton.SetLocalPosition(
            m_scrollFrame.Width / 2 - m_scrollUpButton.Width / 2,
            BORDER_WIDTH);
        m_scrollUpButton.Visible = false;

        m_scrollDownButton =
            new ButtonWidget(this, style.ButtonStyle, 0, 0, "Next");
        m_scrollDownButton.SetLocalPosition(
            m_scrollUpButton.LocalX,
            m_scrollFrame.Height - m_scrollDownButton.Height - BORDER_WIDTH);
        m_scrollDownButton.Visible = false;
    }
        public void When_Given_a_Widget_Id_I_Should_Get_a_fully_initialized_Widget()
        {
            var widgetId = "Namespace.WidgetName";
            var serviceLocator = MockRepository.GenerateMock<IServiceLocatorProvider>();
            serviceLocator.Expect(s => s.ResolveWithKey<IWebWidget>(widgetId)).Return(new HelloWorldWebWidget());
            ServiceLocator.SetLocatorProvider(serviceLocator);

            IWidgetFactory widgetFactory = new WidgetFactory();
            widgetFactory.Create(widgetId);

            serviceLocator.VerifyAllExpectations();
        }
        public ActionResult Sidebar()
        {
            var widgetFactory = new WidgetFactory(this.session);
            var widgets = widgetFactory.GetWidgets();

            var widgetViewModels = widgets.Select(
                w => Mapper.Map(w, w.GetType(), typeof(WidgetViewModel)) as WidgetViewModel);

            var sidebar = new SidebarViewModel
            {
                Widgets = widgetViewModels
            };

            return this.View(sidebar);
        }
Beispiel #5
0
        private void CreateTaskAndScheduler(WidgetFactory factory, int channel, int n)
        {
            var render = factory.CreatePointRender();

            _listPool       = new ListRenderItemPool();
            _listRenderTask = factory.CreateListRenderTask(this.Dispatcher, render, _listPool);
            _viewPool       = new ViewRenderItemPool(render, this.Dispatcher);
            _viewRenderTask = factory.CreateViewRenderTask(this.Dispatcher, render, _viewPool);
            _statisticTask  = factory.CreateStatisticTask(OnExceedLimit);
            _scrollTask     = factory.CreateScrollTask(WaveListBox.OwnedScrollViewer);
            _scheduler      = new WaveTaskScheduler(
                factory.CreateBaseDataSource(channel, n),
                factory.CreateRealDataCollector(channel, n),
                factory.CreateRealDataFile(),
                _listRenderTask,
                _viewRenderTask,
                _statisticTask,
                _scrollTask,
                OnRenderingStarted,
                OnRenderingStoped
                );
        }
        public static void InitWeChatScript(this WidgetFactory ace, Action <IList <string> > actionScript, bool resetUrl = false, bool debug = false)
        {
            if (App.Context.SideInWeixinBrowser())
            {
                var jsApiToken = ace.AC.GetJsApiToken(resetUrl);
                var sb         = new StringBuilder();
                var list       = new List <string>();
                actionScript(list);

                sb.Append("$(function() { AX.wxInit({ ");
                sb.Append($"appId:'{jsApiToken.AppId}',");
                sb.Append($"timestamp:'{jsApiToken.Timestamp}',");
                sb.Append($"nonce:'{jsApiToken.Nonce}',");
                sb.Append($"signature:'{jsApiToken.Signature}',");
                sb.Append($"jsApi:['{list.Join("','")}'],");
                sb.Append($"resetUrl:{resetUrl.ToString().ToLower()},");
                sb.Append($"debug:{debug.ToString().ToLower()}");
                sb.Append(" }) })");

                ace.Context.AppendInitScripts(sb.ToString());
            }
        }
Beispiel #7
0
        /// <summary>
        /// 初始化,UITip
        /// </summary>
        public virtual void Init()
        {
            this.m_Trans = base.transform;
            WidgetFactory.FindAllUIObjects(this.m_Trans, this, ref this.m_dicId2UIObject);
            foreach (var current in this.m_dicId2UIObject.Values)
            {
                current.parent    = this;
                current.ParentDlg = this.ParentDlg;
                string strKey = string.Format("{0}#{1}", this.CachedGameObject.name, current.CachedGameObject.name);
                string tip    = Singleton <UITipConfigMgr> .singleton.GetTip(strKey);//UI提示字符串

                if (!string.IsNullOrEmpty(tip))
                {
                    TipParam tipParam = null;
                    string[] array    = tip.Split(new char[] { '#' });
                    if (array.Length == 1)
                    {
                        tipParam         = new TipParam();
                        tipParam.TipType = EnumTipType.eTipType_Common;
                        tipParam.Tip     = array[0];
                    }
                    else if (array.Length == 2)
                    {
                        tipParam = new TitleTipParam
                        {
                            TipType = EnumTipType.eTipType_Title,
                            Title   = array[0],
                            Tip     = array[1]
                        };
                    }
                    current.TipParam = tipParam;
                }
                if (!current.IsInited)
                {
                    current.Init();
                }
            }
        }
Beispiel #8
0
        public void ApplyOn_TwoColumnsWithDifferentWidths()
        {
            var acts = new[]
            {
                WidgetFactory.Container(new RectangleF(0, 0, 220, 120)),
                WidgetFactory.Container(new RectangleF(0, 0, 120, 330)),
                WidgetFactory.Container(new RectangleF(0, 0, 220, 120)),
                WidgetFactory.Container(new RectangleF(0, 0, 220, 120)),

                WidgetFactory.Container(new RectangleF(0, 0, 220, 120)),
                WidgetFactory.Container(new RectangleF(0, 0, 220, 120)),
                WidgetFactory.Container(new RectangleF(0, 0, 220, 120)),
            };

            var expects = new[]
            {
                new RectangleF(0, 15, 220, 120),
                new RectangleF(0, 135, 120, 330),
                new RectangleF(0, 465, 220, 120),
                new RectangleF(0, 585, 220, 120),

                new RectangleF(220, 15, 220, 120),
                new RectangleF(220, 135, 220, 120),
                new RectangleF(220, 255, 220, 120),
            };

            foreach (var widget in acts)
            {
                _root.AddChild(widget);
            }

            ApplyCol();
            _justifyCenter.ApplyOn(_root);
            for (var i = 0; i < acts.Length; i++)
            {
                Assert.That(acts[i].Space, Is.EqualTo(expects[i]));
            }
        }
Beispiel #9
0
        public void RowWithThreeW_MaximizesSpaceBetween()
        {
            var child  = WidgetFactory.Container(new RectangleF(0, 0, 130, 120));
            var child1 = WidgetFactory.Container(new RectangleF(0, 0, 120, 110));
            var child2 = WidgetFactory.Container(new RectangleF(0, 0, 140, 110));

            _root.AddChild(child);
            _root.AddChild(child1);
            _root.AddChild(child2);

            _root.WithProp(PropFactory.Row());
            _root.WithProp(_justifyBetween);

            ApplyProps(_root);

            var exp  = new RectangleF(0, 0, 130, 120);
            var exp1 = new RectangleF(575, 0, 120, 110);
            var exp2 = new RectangleF(1140, 0, 140, 110);

            Assert.That(child.Space, Is.EqualTo(exp));
            Assert.That(child1.Space, Is.EqualTo(exp1));
            Assert.That(child2.Space, Is.EqualTo(exp2));
        }
        private BaseWidget BuildWidget(BaseField field, UIFormField fieldValue)
        {
            var widgetContext = new WidgetContext(this._formContext);

            if (field == null)
            {
                widgetContext.Build(null, new StackErp.Model.Layout.TField()
                {
                    FieldId = fieldValue.WidgetId
                });
            }
            else
            {
                widgetContext.Build(field, null);
            }

            widgetContext.WidgetType = (FormControlType)fieldValue.WidgetType;
            widgetContext.PostValue  = fieldValue.Value;

            var widget = WidgetFactory.Create(widgetContext);

            return(widget);
        }
Beispiel #11
0
        public void PressOnWidget_ThenEnterAnotherAndRelease_NoReleaseCommandsAreGenerated()
        {
            var thenEntered = WidgetFactory.Container(30, 30);


            _device.Setup(device => device.IsPressed()).Returns(true);
            _handler.Device  = _device.Object;
            _handler.Updater = new InteractionUpdater();

            // Press firstPressed
            _handler.UpdateAndGenerateTransitions(_widgetTree);

            // Move to thenEntered while pressing
            _handler.UpdateAndGenerateTransitions(thenEntered);

            _device.Setup(device => device.IsPressed()).Returns(false);
            _device.Setup(d => d.IsReleased()).Returns(true);
            _handler.Device = _device.Object;

            var l = _handler.UpdateAndGenerateTransitions(thenEntered);

            Assert.That(l, Is.Empty);
        }
Beispiel #12
0
        public void ApplyOn_TwoRowsWithDifferentHeights()
        {
            var acts = new[]
            {
                WidgetFactory.Container(new RectangleF(0, 0, 220, 120)),
                WidgetFactory.Container(new RectangleF(0, 0, 120, 330)),
                WidgetFactory.Container(new RectangleF(0, 0, 220, 120)),
                WidgetFactory.Container(new RectangleF(0, 0, 220, 120)),
                WidgetFactory.Container(new RectangleF(0, 0, 220, 120)),
                WidgetFactory.Container(new RectangleF(0, 0, 220, 120)),
                WidgetFactory.Container(new RectangleF(0, 0, 220, 120)),
            };

            var expects = new[]
            {
                new RectangleF(30, 0, 220, 120),
                new RectangleF(250, 0, 120, 330),
                new RectangleF(370, 0, 220, 120),
                new RectangleF(590, 0, 220, 120),
                new RectangleF(810, 0, 220, 120),
                new RectangleF(1030, 0, 220, 120),
                new RectangleF(30, 330, 220, 120),
            };

            foreach (var widget in acts)
            {
                _root.AddChild(widget);
            }

            ApplyRow();
            _justifyCenter.ApplyOn(_root);
            for (var i = 0; i < acts.Length; i++)
            {
                Assert.That(acts[i].Space, Is.EqualTo(expects[i]));
            }
        }
Beispiel #13
0
        public void ApplyOn_WidgetWithTextChildren_DoesNotOverrideTextChildWithFontFamilyProp()
        {
            // arrange
            var root       = WidgetFactory.Container();
            var testWidget = WidgetFactory.Text("Test string");

            root.AddChild(testWidget);

            FontStore.RegisterFont("mockF3", new Mock <Font>(null).Object);
            var font = new FontFamily("mockF3");

            var mockedFont = new Mock <Font>(null);

            FontStore.RegisterFont("mockF4", mockedFont.Object);
            var fontChild = new FontFamily("mockF4");

            // act
            root.WithProp(font);
            testWidget.WithProp(fontChild);
            TreeVisitor.ApplyPropsOnTree(root);

            // assert
            Assert.That(((Text)testWidget).Font, Is.EqualTo(mockedFont.Object));
        }
Beispiel #14
0
        public GameEngine(MessageBus bus, GameObjectFactory factory, WidgetFactory widgetFactory, IGraphicsLoader graphicsLoader, ISound sound)
        {
            _currentState   = new IdleState(this);
            Timer           = new AsyncObservableTimer();
            Bus             = bus;
            Factory         = factory;
            _graphicsLoader = graphicsLoader;
            Sound           = sound;

            WidgetFactory = widgetFactory;

            Bus.OfType <GraphicsLoadedMessage>().Subscribe(m => {
                Graphics = m.Graphics;
                WidgetFactory.Initialise(Graphics);
                Bus.Add(new GameStartMessage(Timer.LastTickTime));
            });


            IsRunning = false;
            Timer.Subscribe(Update);
            Timer.SubSample(5).Subscribe(t => Bus.SendAll());

            //Timer.Subscribe(t => Bus.Add(new GraphicsDirtyMessage(t)));
        }
Beispiel #15
0
 public ItemBaseTests()
 {
     _itemBase = new ItemBase();
     _root     = WidgetFactory.Container(new RectangleF(0, 0, 1280, 720));
     _child    = WidgetFactory.Container(20, 20);
 }
        public IrisGridBuilder(HtmlHelper helper)
        {
            Type modelType = typeof(T);
            IrisGridAttribute gridAttribute = modelType.GetCustomAttribute <IrisGridAttribute>();

            if (gridAttribute == null)
            {
                throw new InvalidOperationException("You cannot create a grid control with an object that does not have the IrisGridAttribute.");
            }

            DatabaseModelBindings bindings = modelType.GetDatabaseBindings();

            PropertyInfo[]            modelProperties   = modelType.GetProperties();
            AjaxDataSourceBuilder <T> dataSourceBuilder = null;
            UserService userService = new UserService();

            using (SecurityUserService securityUserService = new SecurityUserService())
            {
                WidgetFactory factory = new WidgetFactory(helper);
                builder = factory.Grid <T>();

                builder.DataSource(ds =>
                {
                    dataSourceBuilder = ds.Ajax();
                    //    .Aggregates(a =>
                    //    {
                    //        a.Add(p => p.Labor_Quantity).Sum();
                    //        a.Add(p => p.Equipment_Quantity).Sum();
                    //        a.Add(p => p.Material_Quantity).Sum();
                    //        a.Add(p => p.OutSideService_Quantity).Sum();
                    //    })
                    //dataSourceBuilder.Events(e =>
                    //{
                    //    e.Error("error");
                    //    e.Change("onChange");
                    //});
                    dataSourceBuilder.PageSize(100);
                    dataSourceBuilder.ServerOperation(true);
                    dataSourceBuilder.Read(r => r.Url(GetAbsoluteUrl(gridAttribute.ReadPath)).Type(HttpVerbs.Get));
                    dataSourceBuilder.Create(c => c.Url(GetAbsoluteUrl(gridAttribute.CreatePath)).Type(HttpVerbs.Post));
                    dataSourceBuilder.Update(u => u.Url(GetAbsoluteUrl(gridAttribute.UpdatePath)).Type(HttpVerbs.Post));
                    dataSourceBuilder.Destroy(d => d.Url(GetAbsoluteUrl(gridAttribute.DestroyPath)).Type(HttpVerbs.Post));
                });

                builder.Name("grid");
                builder.Columns(c =>
                {
                    // Create our command column for this object
                    c.Command(command =>
                    {
                        command.Destroy();
                        command.Edit();
                    }).Lockable(true).Locked(false).Width(180).Visible(userService.ValidateSecurityLevel(bindings.TableName, 3));

                    //.Model(model =>
                    //    {
                    //        model.Id(m => m.Timecard_Key);
                    //        model.Field(m => m.Equipment_Unit_Cost).Editable(true);
                    //        model.Field(m => m.FuelImport).Editable(false);
                    //        model.Field(m => m.DateStamp).Editable(false);
                    //        model.Field(m => m.SecurityUser_Key).Editable(false);
                    //        model.Field(m => m.Timecard_Key).DefaultValue("1600000000");
                    //        model.Field(m => m.SecurityUser_Key).DefaultValue(ViewData["CurrentSecurityUser"]);
                    //        model.Field(m => m.CreatedBySecurityUser_Key).DefaultValue(ViewData["CurrentSecurityUser"]);
                    //        model.Field(m => m.DateStamp).DefaultValue(DateTime.Now);
                    //    })

                    dataSourceBuilder.Aggregates(a =>
                    {
                        dataSourceBuilder.Model(model =>
                        {
                            // Setup the columns from our model properties
                            foreach (PropertyInfo p in modelProperties)
                            {
                                // Get our column settings from the property attribute or use a default one
                                IrisGridColumnAttribute columnAttributes = p.GetCustomAttribute <IrisGridColumnAttribute>();
                                if (columnAttributes == null)
                                {
                                    columnAttributes = IrisGridColumnAttribute.Default;
                                }


                                switch (columnAttributes.Aggregate)
                                {
                                case AggregateMode.Sum:
                                    a.Add(p.Name, p.PropertyType).Sum();
                                    break;

                                case AggregateMode.Min:
                                    a.Add(p.Name, p.PropertyType).Min();
                                    break;

                                case AggregateMode.Max:
                                    a.Add(p.Name, p.PropertyType).Max();
                                    break;

                                case AggregateMode.Average:
                                    a.Add(p.Name, p.PropertyType).Average();
                                    break;
                                }

                                if (p.Name == bindings.KeyFieldName)
                                {
                                    model.Id(p.Name);
                                }
                                else
                                {
                                    DataSourceModelFieldDescriptorBuilder <object> fieldBuilder = model.Field(p.Name, p.PropertyType);
                                    if (p.Name.EndsWith("User_Key", StringComparison.InvariantCultureIgnoreCase))
                                    {
                                        fieldBuilder.DefaultValue(securityUserService.CurrentSecurityUser());
                                    }
                                }

                                GridBoundColumnBuilder <T> column = c.Bound(p.Name);
                                column.Lockable(true).Locked(false);

                                // Setup our formatting for this column
                                if (string.IsNullOrEmpty(columnAttributes.Format) == false)
                                {
                                    column.Format(columnAttributes.Format);
                                }

                                // Setup our custom editor templates if they are needed
                                if (p.PropertyType == typeDate)
                                {
                                    column.EditorTemplateName("IRISDate");
                                }

                                // Setup custom attributes
                                if (p.GetCustomAttribute <RequiredAttribute>() != null)
                                {
                                    column.HeaderHtmlAttributes(new { @Class = "required-field" });
                                }

                                column.Width(columnAttributes.Width);
                            }
                        });
                    });
                });

                // Setup our column menus for filtering and sorting
                builder.ColumnMenu(m =>
                {
                    m.Enabled(true);
                    m.Filterable(true);
                    m.Sortable(true);
                    m.Columns(true);
                });

                // Setup our editable configuration
                builder.Editable(e =>
                {
                    e.Mode(GridEditMode.InLine);
                    e.CreateAt(GridInsertRowPosition.Top);
                    e.DisplayDeleteConfirmation(false);
                });

                builder.Events(e =>
                {
                    //    e.Edit("onGridEdit");
                    //    e.Save("ValidateRow");              // Used for Update button
                    //    e.SaveChanges("ValidateRow");       // Used for Alt + s
                    //    e.DataBound("SelectFirstRow");
                });


                //.Excel(excel => excel
                //    .FileName("Timecard.xlsx")
                //    .Filterable(true)
                //    .ProxyURL(Url.Action("Excel_Export_Save", "Grid"))
                //)
                //.Pdf(pdf => pdf
                //    .FileName("Timecard.pdf")
                //    .ProxyURL(Url.Action("Pdf_Export_Save", "Grid"))
                //    .AllPages()
                //)

                builder.Filterable();
                builder.Navigatable(setting => setting.Enabled(true));
                builder.Pageable(p => p.Refresh(true).PageSizes(true).ButtonCount(5));
                builder.Scrollable(a => a.Height(500));
                builder.Resizable(resize => resize.Columns(true));
                builder.Reorderable(reorder => reorder.Columns(true));
                builder.Sortable();
                builder.Selectable();
                //.ToolBar(toolBar =>
                //{
                //    toolBar.Create();
                //    toolBar.Excel();
                //    toolBar.Pdf();
                //})

                //.DataSource(ds => ds
                //    .Ajax()

                //
                //    .Sort(s => s.Add(t => t.Task_Date))



                //.Columns(c =>
                //{
                //    c.Command(command => { command.Destroy(); command.Edit(); }).Lockable(true).Locked(false).Width(180).Visible(AuthHelper.ValidateSecurityLevel("Timecard", 3));
                //    c.Bound(p => p.Task_Date).Width(180).Lockable(true).Locked(false).EditorTemplateName("IRISDate").HeaderHtmlAttributes(new { @Class = "required-field" });
                //    c.ForeignKey(p => p.Activity_Key, (System.Collections.IEnumerable)ViewData["Activities"], "Field1", "Field2").Width(350).Lockable(true).HeaderHtmlAttributes(new { @Class = "required-field" }).EditorTemplateName("IRISGridForeignKeyWithFilter");
                //    c.ForeignKey(p => p.Project_Key, (System.Collections.IEnumerable)ViewData["Projects"], "Field1", "Field2").Width(350).EditorTemplateName("IRISGridForeignKey");
                //    c.ForeignKey(p => p.ProjectSub_Key, (System.Collections.IEnumerable)ViewData["ProjectSubs"], "ProjectSub_Key", "NameDesc").EditorTemplateName("ProjectSub").Width(200);
                //    c.Bound(p => p.Crew_Num).Width(120);
                //    c.ForeignKey(p => p.Employee_Key, (System.Collections.IEnumerable)ViewData["Employees"], "Field1", "Field2").Width(350).EditorTemplateName("IRISGridForeignKey");
                //    c.Bound(p => p.Labor_Quantity).HtmlAttributes(new { style = "text-align: right" }).Width(150).ClientGroupFooterTemplate("Sum: #= kendo.format('{0:n}', sum)#").ClientFooterTemplate("Sum: #= kendo.format('{0:n}', sum)#");
                //    c.ForeignKey(p => p.Pay_Type_Key, (System.Collections.IEnumerable)ViewData["Pay_Types"], "Field1", "Field2").Width(150).EditorTemplateName("IRISGridForeignKey");
                //    c.ForeignKey(p => p.Premium_Key, (System.Collections.IEnumerable)ViewData["Premiums"], "Field1", "Field2").Width(150).EditorTemplateName("IRISGridForeignKey");
                //    c.Bound(p => p.Override_Labor_Rate).Format("{0:c}").HtmlAttributes(new { style = "text-align: right" }).Width(200);
                //    c.Bound(p => p.Production).HtmlAttributes(new { style = "text-align: right" }).Width(130).ClientGroupFooterTemplate("Sum: #= kendo.format('{0:n}', sum)#").ClientFooterTemplate("Sum: #= kendo.format('{0:n}', sum)#");
                //    c.Bound(p => p.Equipment_Quantity).HtmlAttributes(new { style = "text-align: right" }).Width(200).ClientGroupFooterTemplate("Sum: #= kendo.format('{0:n}', sum)#").ClientFooterTemplate("Sum: #= kendo.format('{0:n}', sum)#");
                //    c.ForeignKey(p => p.Equipment_Key, (System.Collections.IEnumerable)ViewData["Equipments"], "Field1", "Field2").Width(350).EditorTemplateName("IRISGridForeignKey");
                //    c.Bound(p => p.Equipment_Unit_Cost).Format("{0:c}").HtmlAttributes(new { style = "text-align: right" }).Width(120);
                //    c.Bound(p => p.Material_Quantity).HtmlAttributes(new { style = "text-align: right" }).Width(120).ClientGroupFooterTemplate("Sum: #= kendo.format('{0:n}', sum)#").ClientFooterTemplate("Sum: #= kendo.format('{0:n}', sum)#");
                //    c.ForeignKey(p => p.Inventory_Location_Key, (System.Collections.IEnumerable)ViewData["Inventory_Locations"], "Inventory_Location_Key", "NameDesc").Width(350).EditorTemplateName("IRISGridForeignKey");
                //    c.Bound(p => p.UOMName).Width(100);
                //    c.Bound(p => p.Material_Description).Width(120);
                //    c.Bound(p => p.Material_Unit_Cost).Format("{0:c}").HtmlAttributes(new { style = "text-align: right" }).Width(150);
                //    c.ForeignKey(p => p.ResourceClass_Key, (System.Collections.IEnumerable)ViewData["ResourceClasss"], "Field1", "Field2").Width(350).EditorTemplateName("IRISGridForeignKey");
                //    c.Bound(p => p.OutSideServiceDescription).Width(120);
                //    c.Bound(p => p.OutSideService_Quantity).HtmlAttributes(new { style = "text-align: right" }).Width(100);
                //    c.Bound(p => p.OutSideServiceCost).Format("{0:c}").HtmlAttributes(new { style = "text-align: right" }).Width(120);
                //    c.ForeignKey(p => p.Mgt_Unit_Key, (System.Collections.IEnumerable)ViewData["Mgt_Units"], "Field1", "Field2").Width(350).EditorTemplateName("IRISGridForeignKey");
                //    c.ForeignKey(p => p.Program_Key, (System.Collections.IEnumerable)ViewData["Programs"], "Field1", "Field2").Width(350).EditorTemplateName("IRISGridForeignKey");
                //    c.ForeignKey(p => p.Zone_Key, (System.Collections.IEnumerable)ViewData["Zones"], "Field1", "Field2").Width(350).EditorTemplateName("IRISGridForeignKey");
                //    c.ForeignKey(p => p.RBF_Key, (System.Collections.IEnumerable)ViewData["RBFs"], "Field1", "Field2").Width(200).EditorTemplateName("IRISGridForeignKey");
                //    c.ForeignKey(p => p.Road_Key, (System.Collections.IEnumerable)ViewData["Roads"], "Field1", "Field2").Width(200).EditorTemplateName("IRISGridForeignKey");
                //    c.ForeignKey(p => p.RoadName_Key, (System.Collections.IEnumerable)ViewData["RoadNames"], "Field1", "Field2").Width(200).EditorTemplateName("IRISGridForeignKey");
                //    c.Bound(p => p.Beg_Point).Width(120);
                //    c.Bound(p => p.End_Point).Width(120);
                //    c.Bound(p => p.FromLocation).Width(180);
                //    c.Bound(p => p.ToLocation).Width(180);
                //    c.ForeignKey(p => p.Reason_Key, (System.Collections.IEnumerable)ViewData["Reasons"], "Field1", "Field2").Width(200).EditorTemplateName("IRISGridForeignKey");
                //    c.Bound(p => p.Comments).Width(280);
                //    c.Bound(p => p.EquipmentMiles).HtmlAttributes(new { style = "text-align: right" }).Width(250);
                //    c.Bound(p => p.EquipmentHours).HtmlAttributes(new { style = "text-align: right" }).Width(250);

                //    // User defined fields
                //    string title;
                //    string userType;


                //    //ViewBag.UserDefinedFields.User1
                //    for (int i = 0; i < ViewBag.UserDefinedFields.Count; i++ )

                //    {
                //        title = ViewBag.UserDefinedFields[i].Title;
                //        userType = ViewBag.UserDefinedFields[i].Type;


                //        switch (userType)
                //        {
                //            case "String":
                //                c.Bound(ViewBag.UserDefinedFields[i].Field).Title(title).Width(120);
                //                break;
                //            case "Date":
                //                c.Bound(ViewBag.UserDefinedFields[i].Field).Title(title).EditorTemplateName("Date").Width(150);
                //                break;
                //            case "Numeric":
                //                c.Bound(ViewBag.UserDefinedFields[i].Field).Title(title).EditorTemplateName("Number").HtmlAttributes(new { style = "text-align: right" }).Width(120);
                //                break;
                //            case "Checkbox":
                //                c.Bound(ViewBag.UserDefinedFields[i].Field).Title(title).HtmlAttributes(new { style = "text-align: center" }).ClientTemplate("<input type='checkbox' #=" + ViewBag.UserDefinedFields[i].Field + " ? checked='checked' : '' # class='chkbx' disabled='disabled'></input>").Width(120);
                //                break;
                //            case "Lookup":
                //                c.ForeignKey(ViewBag.UserDefinedFields[i].Field, (System.Collections.IEnumerable)ViewData["LookupUser" + (i + 1).ToString()], "Field1", "Field2").Width(350).EditorTemplateName("IRISGridForeignKey");
                //                break;
                //        }

                //    }

                //    c.Bound(p => p.FuelImport).HtmlAttributes(new { style = "text-align: center" }).ClientTemplate("<input type='checkbox' #=FuelImport ? checked='checked' : '' # class='chkbx' disabled='disabled' readonly='readonly'></input>").Width(200);
                //    c.Bound(p => p.Error_Message).Width(220);
                //    c.Bound(p => p.DateStamp).Format("{0: MM/d/yyyy hh:mm:ss}").Width(175);
                //    c.ForeignKey(p => p.SecurityUser_Key, (System.Collections.IEnumerable)ViewData["SecurityUsers"], "SecurityUser_Key", "UserName").Width(140);
                //})
                //)
            }
        }
Beispiel #17
0
 /// <summary>
 /// Factory widget creation
 /// </summary>
 /// <param name="aArgs">
 /// A <see cref="FactoryInvocationArgs"/>
 /// </param>
 /// <returns>
 /// A <see cref="IAdaptableControl"/>
 /// </returns>
 public static IAdaptableControl CreateWidget(FactoryInvocationArgs aArgs)
 {
     return(WidgetFactory.CreateWidget(gtkCreationMethod, aArgs));
 }
Beispiel #18
0
 /// <summary>
 /// Returns an instance of <see cref="IWidget"/> or one of its subclasses that
 /// represents the qooxdoo widget containing the specified element. </summary>
 /// <param name="element"> A <see cref="IWebElement"/> representing a DOM element that is part of a
 /// qooxdoo widget </param>
 /// <returns>Widget object.</returns>
 public virtual IWidget GetWidgetForElement(IWebElement element)
 {
     return(WidgetFactory.GetWidgetForElement(element));
 }
 public static ButtonBuilder Button(this WidgetFactory widgetFactory)
 {
     return(new ButtonBuilder(new Button(widgetFactory.HtmlHelper.ViewContext, widgetFactory.Initializer, widgetFactory.UrlGenerator)));
 }
Beispiel #20
0
 public ListBox(WidgetFactory ace)
     : base(ace)
 {
     base.Widget = "listbox";
 }
Beispiel #21
0
            public SettingsPanel()
            {
                AddWidget(WidgetFactory.CreateMissingDebugShadersWarning());

                var debugDisplaySettings = UniversalRenderPipelineDebugDisplaySettings.Instance;
                var materialSettingsData = debugDisplaySettings.materialSettings;

                AddWidget(new DebugUI.Foldout
                {
                    displayName = "Material Filters",
                    isHeader    = true,
                    opened      = true,
                    children    =
                    {
                        DebugDisplaySettingsMaterial.WidgetFactory.CreateMaterialOverride(materialSettingsData)
                    },
                    contextMenuItems = new List <DebugUI.Foldout.ContextMenuItem>()
                    {
                        new DebugUI.Foldout.ContextMenuItem
                        {
                            displayName = k_GoToSectionString,
                            action      = () => { DebugManager.instance.RequestEditorWindowPanelIndex(1); }
                        }
                    }
                });

                var lightingSettingsData = debugDisplaySettings.lightingSettings;

                AddWidget(new DebugUI.Foldout
                {
                    displayName = "Lighting Debug Modes",
                    isHeader    = true,
                    opened      = true,
                    children    =
                    {
                        DebugDisplaySettingsLighting.WidgetFactory.CreateLightingDebugMode(lightingSettingsData),
                        DebugDisplaySettingsLighting.WidgetFactory.CreateLightingFeatures(lightingSettingsData)
                    },
                    contextMenuItems = new List <DebugUI.Foldout.ContextMenuItem>()
                    {
                        new DebugUI.Foldout.ContextMenuItem
                        {
                            displayName = k_GoToSectionString,
                            action      = () => { DebugManager.instance.RequestEditorWindowPanelIndex(2); }
                        }
                    }
                });

                var renderingSettingsData = debugDisplaySettings.renderingSettings;

                AddWidget(new DebugUI.Foldout
                {
                    displayName = "Rendering Debug",
                    isHeader    = true,
                    opened      = true,
                    children    =
                    {
                        DebugDisplaySettingsRendering.WidgetFactory.CreateHDR(renderingSettingsData),
                        DebugDisplaySettingsRendering.WidgetFactory.CreateMSAA(renderingSettingsData),
                        DebugDisplaySettingsRendering.WidgetFactory.CreatePostProcessing(renderingSettingsData),
                        DebugDisplaySettingsRendering.WidgetFactory.CreateAdditionalWireframeShaderViews(renderingSettingsData),
                        DebugDisplaySettingsRendering.WidgetFactory.CreateWireframeNotSupportedWarning(renderingSettingsData),
                        DebugDisplaySettingsRendering.WidgetFactory.CreateOverdrawMode(renderingSettingsData),
                        DebugDisplaySettingsRendering.WidgetFactory.CreateMaxOverdrawCount(renderingSettingsData),
                    },
                    contextMenuItems = new List <DebugUI.Foldout.ContextMenuItem>()
                    {
                        new DebugUI.Foldout.ContextMenuItem
                        {
                            displayName = k_GoToSectionString,
                            action      = () => { DebugManager.instance.RequestEditorWindowPanelIndex(3); }
                        }
                    }
                });
            }
Beispiel #22
0
 public View(WidgetFactory ace)
     : base(ace)
 {
 }
 public static ActionLinkBuilder ActionLink(this WidgetFactory widgetFactory)
 {
     return(new ActionLinkBuilder(new ActionLink(widgetFactory.HtmlHelper.ViewContext, widgetFactory.Initializer, widgetFactory.UrlGenerator)));
 }
Beispiel #24
0
 public void BeforeEach()
 {
     _column = new Column();
     _root   = WidgetFactory.Container(new RectangleF(0, 0, 1280, 720));
 }
 public static TextboxBuilder Textbox(this WidgetFactory widgetFactory)
 {
     return(new TextboxBuilder(new Textbox(widgetFactory.HtmlHelper.ViewContext, widgetFactory.Initializer, widgetFactory.UrlGenerator)));
 }
Beispiel #26
0
 public AddressBox(WidgetFactory ace)  : base(ace)
 {
     this.Widget = "addressbox";
 }
Beispiel #27
0
 public LayoutItem(WidgetFactory ace)
     : base(ace)
 {
     base.Widget = null;
 }
Beispiel #28
0
 /// <summary>
 /// Checks specified type if it provides factory or not and then registers it
 /// if needed
 /// </summary>
 /// <param name="aType">
 /// Factory type <see cref="System.Type"/>
 /// </param>
 public static void RegisterClass(System.Type aType)
 {
     WidgetFactory.RegisterClass(aType);
 }
Beispiel #29
0
 /// <summary>
 /// Factory widget creation
 /// </summary>
 /// <param name="aArgs">
 /// A <see cref="FactoryInvocationArgs"/>
 /// </param>
 /// <returns>
 /// A <see cref="IMappedColumnItem"/>
 /// </returns>
 public static IMappedColumnItem CreateCell(FactoryInvocationArgs aArgs)
 {
     return(WidgetFactory.CreateCell(gtkCellCreationMethod, aArgs));
 }
Beispiel #30
0
 /// <summary>
 /// Enumerates all factory providers by specified filter
 /// </summary>
 /// <param name="aType">
 /// Type for which responsible widgets should be enumerated <see cref="System.Type"/>
 /// </param>
 /// <returns>
 /// All invoker classes by specified filter <see cref="IEnumerable"/>
 /// </returns>
 public static IEnumerable AllCellWidgetsForType(System.Type aType)
 {
     return(WidgetFactory.AllCellsByFilterForType("Gtk", aType));
 }
Beispiel #31
0
 /// <summary>
 /// Enumerates all factory providers registred for Gtk
 /// </summary>
 /// <returns>
 /// All invoker classes by specified filter <see cref="IEnumerable"/>
 /// </returns>
 public static IEnumerable AllCellWidgets()
 {
     return(WidgetFactory.AllCellsByFilter("Gtk"));
 }
Beispiel #32
0
 public void Construct(UIManagerConfig uiManagerConfig, WidgetFactory widgetFactory)
 {
     _uiManagerConfig = uiManagerConfig;
     _widgetFactory   = widgetFactory;
 }
Beispiel #33
0
 public Htmler(WidgetFactory ace)
     : base(ace)
 {
     base.Widget = "htmler";
 }
Beispiel #34
0
 public TagBox(WidgetFactory ace) : base(ace)
 {
     base.Widget = "tagbox";
 }