Exemplo n.º 1
0
        private void FixDeleteButtonPosition()
        {
            var position = DetailList.GetCellPosition(_deleteButton);

            if (position.Row != FirstRow)
            {
                DetailList.SetCellPosition(_deleteButton, new TableLayoutPanelCellPosition(2, FirstRow));
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 绑定列表
 /// </summary>
 private void BindList()
 {
     DetailLabel.Visible = true;
     using (ContractProvider contProvider = new ContractProvider())
     {
         List.DataSource       = contProvider.GetContractHeadInfo(ORDNO.Text.Trim());
         DetailList.DataSource = contProvider.GetContractDetailKp(ORDNO.Text.Trim());
     }
     List.DataBind();
     DetailList.DataBind();
 }
Exemplo n.º 3
0
 public void RemoveDetail(Detail detail)
 {
     foreach (var item in DetailList)
     {
         if (item.DetailName == detail.DetailName)
         {
             DetailList.Remove(item);
             break;
         }
     }
 }
Exemplo n.º 4
0
        public void EmptyViewTemplateWithMinorLabel()
        {
            LexEntry entry = GetNewEntry();

            using (DetailList dl = new DetailList())
            {
                LexEntryLayouter layout = new LexEntryLayouter(dl, 0, new ViewTemplate(), null, Context, entry, false, () => new TestConfirmDelete(), true);
                layout.AddWidgets();
                Assert.AreEqual(0, dl.RowCount);
            }
        }
 protected CustomizedDetailList(T dataSourceControl)
 {
     Assert.ArgumentNotNull(dataSourceControl, "dataSourceControl");
     this.dataSourceControl = dataSourceControl;
     this.filterBuidler     = new FilterBuilder();
     this.detailList        = new DetailList();
     this.accordion         = new Accordion();
     this.DetailListKeys    = new List <string>();
     this.smartPanel        = new Popup();
     //this.ViewState["EnabledVS"] = true;
     this.hiddenInput = new HtmlInputHidden();
 }
Exemplo n.º 6
0
        internal override int AddWidgets(PalasoDataObject wsdo, int insertAtRow)
        {
            LexExampleSentence example = (LexExampleSentence)wsdo;

            FirstRow = insertAtRow;

            DetailList.SuspendLayout();
            int rowCount = 0;

            try
            {
                Field field =
                    ActiveViewTemplate.GetField(Field.FieldNames.ExampleSentence.ToString());
                if (field != null && field.GetDoShow(example.Sentence, ShowNormallyHiddenFields))
                {
                    Control control = MakeBoundControl(example.Sentence, field);
                    DetailList.AddWidgetRow(
                        StringCatalog.Get("~Example",
                                          "This is the field containing an example sentence of a sense of a word."),
                        false,
                        control,
                        insertAtRow,
                        false);
                    ++rowCount;
                    insertAtRow = DetailList.GetRow(control);
                }

                field = ActiveViewTemplate.GetField(Field.FieldNames.ExampleTranslation.ToString());
                if (field != null && field.GetDoShow(example.Translation, ShowNormallyHiddenFields))
                {
                    Control entry = MakeBoundControl(example.Translation, field);
                    DetailList.AddWidgetRow(
                        StringCatalog.Get("~Translation",
                                          "This is the field for putting in a translation of an example sentence."),
                        false,
                        entry,
                        insertAtRow + rowCount,
                        false);
                    ++rowCount;
                }

                rowCount += AddCustomFields(example, insertAtRow + rowCount);
            }
            catch (ConfigurationException e)
            {
                ErrorReport.NotifyUserOfProblem(e.Message);
            }

            DetailList.ResumeLayout(false);
            LastRow = insertAtRow + rowCount - 1;               // want index of last row owned, not a limit value
            return(rowCount);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 绑定列表
        /// </summary>
        private void BindList()
        {
            using (PurProvider purProvider = new PurProvider())
            {
                DataTable table = purProvider.GetPRCheckList();
                List.DataSource = table;
            }
            List.DataBind();

            this.List.SelectedIndex = -1;
            DetailList.DataSource   = null;
            DetailList.DataBind();
        }
Exemplo n.º 8
0
        protected void List_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        {
            this.List.SelectedIndex = e.NewSelectedIndex;
            string no = this.List.DataKeys[this.List.SelectedIndex]["ordno"].ToString();

            //绑定详情列表
            DetailLabel.Visible = true;
            using (ContractProvider contProvider = new ContractProvider())
            {
                DetailList.DataSource = contProvider.GetContractStatsDetail(no);
            }
            DetailList.DataBind();
        }
Exemplo n.º 9
0
        private void AddExampleSentenceGhost(LexSense sense, int insertAtRow)
        {
            DetailList.SuspendLayout();
            var exampleLayouter =
                new LexExampleSentenceLayouter(DetailList, insertAtRow, ActiveViewTemplate, _serviceProvider, null)
            {
                ParentLayouter = this
            };

            exampleLayouter.AddGhost(null, sense.ExampleSentences, insertAtRow);
            ChildLayouts.Add(exampleLayouter);
            DetailList.ResumeLayout(false);
        }
Exemplo n.º 10
0
        protected void List_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        {
            this.List.SelectedIndex = e.NewSelectedIndex;
            string no = this.List.DataKeys[this.List.SelectedIndex]["PRHNO"].ToString();

            //绑定详情列表
            //DetailLabel.Visible = true;
            using (PurProvider purProvider = new PurProvider())
            {
                DetailList.DataSource = purProvider.GetPRCheckDetail(no);
            }
            DetailList.DataBind();
        }
Exemplo n.º 11
0
        protected int MakeGhostWidget <T>(PalasoDataObject parent,
                                          IList <T> list,
                                          string fieldName,
                                          string label,
                                          string propertyName,
                                          bool isHeading,
                                          int row) where T : PalasoDataObject, new()
        {
            Field field = ActiveViewTemplate.GetField(fieldName);

            if (field != null && field.Enabled &&
                field.Visibility == CommonEnumerations.VisibilitySetting.Visible)
            {
                DetailList.SuspendLayout();
                MultiTextControl m = new MultiTextControl(field.WritingSystemIds,
                                                          new MultiText(),
                                                          fieldName + "_ghost",
                                                          false,
                                                          BasilProject.Project.WritingSystems,
                                                          field.Visibility,
                                                          field.IsSpellCheckingEnabled, false, _serviceProvider);
                if (_columnWidths != null && _columnWidths.Length == 3)
                {
                    m.Width = _columnWidths[1];
                }

                Control refWidget = DetailList.AddWidgetRow(label,
                                                            isHeading,
                                                            m,
                                                            row,
                                                            true);

                foreach (IControlThatKnowsWritingSystem box in m.TextBoxes)
                {
                    var tb = box as IWeSayTextBox;
                    if (tb != null)
                    {
                        GhostBinding <T> g = MakeGhostBinding(parent, list, propertyName, box.WritingSystem, tb);
                        g.ReferenceControl = refWidget;
                    }
                }
                DetailList.ResumeLayout(false);
                return(1);
            }
            else
            {
                return(0);                //didn't add a row
            }
        }
Exemplo n.º 12
0
        private DetailList MakeDetailList(bool showNormallyHiddenFields, bool showMinorMeaningLabel, ViewTemplate template)
        {
            //TODO need tests for other data types when made optional
            //TODO need tests for showing non-empty optional tests in non-show-all mode

            LexEntry entry = GetNewEntry();

            DetailList       dl     = new DetailList();
            LexEntryLayouter layout = new LexEntryLayouter(dl, 0, template, null, Context, entry, false, () => new TestConfirmDelete(), showMinorMeaningLabel);

            layout.ShowNormallyHiddenFields = showNormallyHiddenFields;
            layout.AddWidgets();
            _rowCount = dl.RowCount;
            return(dl);
        }
Exemplo n.º 13
0
        void FormSelectCar_Load(object sender, EventArgs e)
        {
            _cars = new CarDAO().GetList();

            if (Existscars != null && Existscars.Any())
            {
                _cars.RemoveAll(m => Existscars.Exists(n => m.CarID == n.CarID));
            }
            gc_Car.DataSource = Cars;
            gc_Car.RefreshDataSource();

            Selectedcars        = new DetailList <Car>();
            gcSelect.DataSource = Selectedcars;
            gcSelect.RefreshDataSource();
        }
Exemplo n.º 14
0
        private static MultiTextControl GetEditControl(DetailList detailList, string labelText)
        {
            MultiTextControl editControl = null;

            for (int i = 0; i < detailList.RowCount; i++)
            {
                Label label = detailList.GetLabelControlFromRow(i);
                if (label != null && label.Text == labelText)
                {
                    editControl = (MultiTextControl)detailList.GetEditControlFromRow(i);
                    break;
                }
            }
            return(editControl);
        }
Exemplo n.º 15
0
        private static DeleteButton GetDeletebutton(DetailList detailList, string labelText)
        {
            DeleteButton deleteButton = null;

            for (int i = 0; i < detailList.RowCount; i++)
            {
                Label label = detailList.GetLabelControlFromRow(i);
                if (label != null && label.Text == labelText)
                {
                    deleteButton = detailList.GetDeleteButton(i);
                    break;
                }
            }
            return(deleteButton);
        }
Exemplo n.º 16
0
        internal void Update(Move move)
        {
            move.Description = Description;

            move.Year  = Year;
            move.Month = Month;
            move.Day   = Day;

            move.Nature = Nature;
            move.Value  = Value;

            move.DetailList = DetailList
                              .Select(d => d.Convert())
                              .ToList();
        }
Exemplo n.º 17
0
 public LexEntryLayouter(DetailList parentDetailList,
                         int parentRow,
                         ViewTemplate viewTemplate,
                         LexEntryRepository lexEntryRepository,
                         IServiceLocator serviceLocator,
                         LexEntry entry,
                         bool sensesAreDeletable,
                         ConfirmDeleteFactory confirmDeleteFactory)
     : base(parentDetailList, parentRow, viewTemplate, lexEntryRepository, CreateLayoutInfoServiceProvider(serviceLocator, entry), entry)
 {
     Entry = entry;
     _sensesAreDeletable       = sensesAreDeletable;
     _confirmDeleteFactory     = confirmDeleteFactory;
     DetailList.LabelsChanged += OnLabelsChanged;
     _columnWidths             = parentDetailList.GetColumnWidths();
 }
        public CountViewModel(int?id)
        {
            Items.Clear();
            Details.Clear();
            DetailList.Clear();

            countServices = new CountServices();
            syncServices  = new SyncServices();

            //if (id == null)
            //    LoadItems();
            //else
            //    LoadDetailsPlan((int)id);

            User = "******";
        }
Exemplo n.º 19
0
        /// <summary>
        /// 绑定列表
        /// </summary>
        private void BindList()
        {
            using (ContractProvider contProvider = new ContractProvider())
            {
                string dFrom = string.IsNullOrWhiteSpace(DateFrom.Text.Trim()) ? string.Empty :
                               LocalGlobal.ConvertDateFormat(DateFrom.Text.Trim()).ToString("yyyyMMdd");
                string dTo = string.IsNullOrWhiteSpace(DateTo.Text.Trim()) ? string.Empty :
                             LocalGlobal.ConvertDateFormat(DateTo.Text.Trim()).ToString("yyyyMMdd");

                List.DataSource = contProvider.GetContractList(ORDNO.Text.Trim(), CUSTNO.Text.Trim(), CUSTNAME.Text.Trim(), dFrom, dTo);
            }
            List.DataBind();

            this.List.SelectedIndex = -1;
            DetailList.DataSource   = null;
            DetailList.DataBind();
        }
Exemplo n.º 20
0
 public void EditField_Change_DisplayedInFormattedView()
 {
     using (
         EntryViewControl entryViewControl = CreateFilteredForm(apple,
                                                                Field.FieldNames.
                                                                EntryLexicalForm.
                                                                ToString(),
                                                                "LexEntry",
                                                                WritingSystemsIdsForTests.VernacularIdForTest)
         )
     {
         DetailList       entryDetailControl = entryViewControl.ControlEntryDetail;
         MultiTextControl editControl        =
             (MultiTextControl)entryDetailControl.GetEditControlFromRow(0);
         editControl.TextBoxes[0].Text = "test";
         Assert.IsTrue(entryViewControl.RtfContentsOfPreviewForTests.Contains("test"));
     }
 }
Exemplo n.º 21
0
        public DetailList GetAllDetails()
        {
            var TitleSC2 = "SC2"; // here better change to post
            var TitleSC3 = "SC3";

            var detailsList = new DetailList()
            {
                BasePriceSC2 = _modelRepository.Get(m => m.Title == TitleSC2).FirstOrDefault().BasePrice,

                BasePriceSC3 = _modelRepository.Get(m => m.Title == TitleSC3).FirstOrDefault().BasePrice,

                CustomBeltGuardPrice = _basePriceRepository.Get(b => b.Type.Contains("CustomArtworkBeltGuard")).FirstOrDefault().Price,

                CustomFrameforkPrice = _basePriceRepository.Get(b => b.Type.Contains("CustomArtworkFrameFork")).FirstOrDefault().Price,

                CustomFlywheelPrice = _basePriceRepository.Get(b => b.Type.Contains("CustomArtworkFlywheel")).FirstOrDefault().Price,

                CustomColorPrice = _basePriceRepository.Get(b => b.Type.Contains("CustomPaintColor")).FirstOrDefault().Price,

                PaintColors = GetColorImages(),

                PlasticsColors = GetOptions <PlasticsColorType>(),

                Seats = GetOptions <SeatType>(),

                Handlebars = GetOptions <HandlebarType>(),

                Pedals = GetOptions <PedalType>(),

                PowerMeters = GetOptions <PowerMeterType>(),

                Consoles = Mapper.MapLists(_consoleRepository.GetAll()),

                SprintShifts = Mapper.MapLists(_sprintShiftRepository.GetAll()),

                ArtworkBeltGuards = Mapper.MapLists(_artworkBeltGuardRepository.GetAll().Where(a => a.BasePrice.Type.Contains("StandartArtworkBeltGuard"))),

                ArtworkFlywheels = Mapper.MapLists(_artworkFlywheelRepository.GetAll().Where(a => a.BasePrice.Type.Contains("StandartArtworkFlywheel"))),

                ArtworkFrameForks = Mapper.MapLists(_artworkFrameForkRepository.GetAll().Where(a => a.BasePrice.Type.Contains("StandartArtworkFrameFork")))
            };

            return(detailsList);
        }
Exemplo n.º 22
0
        private string GetLabelOfMeaningRow(int whichMeaningZeroBased)
        {
            DetailList detailList =
                ((DictionaryControl)_task.Control).Control_EntryDetailPanel.ControlEntryDetail;
            int foundSoFar = -1;

            for (int i = 0; i < detailList.RowCount; i++)
            {
                Label label = detailList.GetLabelControlFromRow(i);
                if (label.Text.Contains("Meaning"))
                {
                    ++foundSoFar;
                    if (foundSoFar == whichMeaningZeroBased)
                    {
                        return(label.Text);
                    }
                }
            }
            return("Not Found");
        }
Exemplo n.º 23
0
 private void EnsureField_Change_UpdatesSenseMeaning(LexEntry entry)
 {
     using (EntryViewControl entryViewControl = CreateFilteredForm(
                entry,
                _primaryMeaningFieldName,
                "LexSense",
                WritingSystemsIdsForTests.AnalysisIdForTest
                ))
     {
         DetailList entryDetailControl = entryViewControl.ControlEntryDetail;
         Label      labelControl       = entryDetailControl.GetLabelControlFromRow(0);
         Assert.AreEqual("Meaning 1", labelControl.Text);
         MultiTextControl editControl =
             (MultiTextControl)entryDetailControl.GetEditControlFromRow(0);
         editControl.TextBoxes[0].Focus();
         editControl.TextBoxes[0].Text = "test";
         entryDetailControl.GetEditControlFromRow(2).Focus();
         Assert.IsTrue(editControl.TextBoxes[0].Text.Contains(GetMeaning(entry)));
     }
 }
Exemplo n.º 24
0
 private void InitializeDetailList()
 {
     _scrollableContainer.SuspendLayout();
     _detailListControl = new DetailList();
     _detailListControl.SuspendLayout();
     _detailListControl.BackColor    = BackColor;
     _detailListControl.Name         = "LexEntryDetailList";
     _detailListControl.TabIndex     = 1;
     _detailListControl.Size         = new Size(_scrollableContainer.ClientRectangle.Width - 20, _detailListControl.Height);
     _detailListControl.Anchor       = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
     _detailListControl.SizeChanged += OnScrollableContainerOrDetailListSizeChanged;
     _detailListControl.AutoSize     = true;
     _detailListControl.ChangeOfWhichItemIsInFocus += OnChangeOfWhichItemIsInFocus;
     _detailListControl.KeyDown     += _detailListControl_KeyDown;
     _detailListControl.MouseWheel  += OnDetailListMouseWheel;
     _detailListControl.GeckoOption  = WeSayWordsProject.GeckoOption;
     _scrollableContainer.AutoScroll = true;
     _scrollableContainer.Controls.Add(_detailListControl);
     _detailListControl.ResumeLayout(false);
     _scrollableContainer.ResumeLayout(false);
 }
Exemplo n.º 25
0
        internal void OnSenseDeleteClicked(object sender, EventArgs e)
        {
            var            sendingLayouter          = (Layouter)sender;
            var            sense                    = (LexSense)sendingLayouter.PdoToLayout;
            IConfirmDelete confirmation             = _confirmDeleteFactory();
            var            deletionStringToLocalize = StringCatalog.Get("This will permanently remove the meaning");

            confirmation.Message = String.Format("{0} {1}.", deletionStringToLocalize,
                                                 sense.Definition.GetBestAlternative(ActiveViewTemplate.GetDefaultWritingSystemForField(LexSense.WellKnownProperties.Definition).Id));
            if (!confirmation.DeleteConfirmed)
            {
                return;
            }
            DetailList.SuspendLayout();
            Entry.Senses.Remove(sense);
            DetailList.Clear();
            //for now just relayout the whole thing as the meaning numbers will change etc.
            AddWidgets();
            DetailList.ResumeLayout();
            // For Linux/Mono, merely resuming layout doesn't work -- the display doesn't redraw properly.
            ForceLayoutAndRefresh();
        }
Exemplo n.º 26
0
        public Panel()
        {
            InitializeComponent();

            // set the base properties
            Text           = "Tidal Clock";
            DoubleBuffered = true;
            Height         = 800;
            Width          = 1280;
            DoubleBuffer   = BufferedGraphicsManager.Current.Allocate(CreateGraphics(), new Rectangle(0, 0, Width, Height));
            Canvas         = DoubleBuffer.Graphics;
            Resize        += ResizeWindow;
            Paint         += PaintWindow;

            // create drawable surface
            TideClockImage    = new WritableBitmap(width: 4096, height: 4096);                     // keep 1:1 ratio
            DigitalClockImage = new WritableBitmap(width: 4096, height: (int)(4096f * (1f / 2f))); // keep 2:1 ratio
            DetailListImage   = new WritableBitmap(width: 4096, height: (int)(4096f * (4f / 5f))); // keep 5:4 ratio
            WeatherListImage  = new WritableBitmap(width: 4096, height: (int)(4096f * (2f / 5f))); // keep 5:2 ratio

            // https://www.tidesandcurrents.noaa.gov/tide_predictions.html
            External = new Predictions("La Push, WA", noahStationId: 9442396, lat: 47.9133f, lng: -124.6369f, subnet: "");

            // create clock face
            TideClock             = new TideClock(TideClockImage.Canvas, External);
            TideClock.OnRendered += FrameRender;

            // create the digital clock
            DigitalClock             = new DigitalClock(DigitalClockImage.Canvas, hasseconds: true, digitalclockface: true);
            DigitalClock.OnRendered += FrameRender;

            // create detail list
            DetailList             = new DetailList(DetailListImage.Canvas, External);
            DetailList.OnRendered += FrameRender;

            // create weather list
            WeatherList             = new WeatherList(WeatherListImage.Canvas, External);
            WeatherList.OnRendered += FrameRender;
        }
Exemplo n.º 27
0
        private void MenuItemDetailCopy_Click(object sender, RoutedEventArgs e)
        {
            MessageItem[] items = DetailList.SelectedMessages();
            if (items == null)
            {
                return;
            }

            StringBuilder sb = new StringBuilder();

            try
            {
                for (int i = 0; i < items.Length; i++)
                {
                    sb.Append(items[i].MText + Environment.NewLine);
                }

                Clipboard.SetText(sb.ToString());
            }
            catch (Exception exp) { ExceptionHelper.Log(exp); }

            sb.Clear();
        }
Exemplo n.º 28
0
        public void FormattedView_FocusInControl_Displayed()
        {
            using (
                EntryViewControl entryViewControl = CreateFilteredForm(apple,
                                                                       Field.FieldNames.
                                                                       EntryLexicalForm.
                                                                       ToString(),
                                                                       "LexEntry",
                                                                       WritingSystemsIdsForTests.VernacularIdForTest)
                )
            {
                // entryViewControl.ControlFormattedView.Select();
                string rtfOriginal = entryViewControl.RtfContentsOfPreviewForTests;

                DetailList entryDetailControl = entryViewControl.ControlEntryDetail;
                Control    editControl        = entryDetailControl.GetEditControlFromRow(0);

                //JDH added after we added multiple ws's per field. Was: editControl.Select();
                ((MultiTextControl)editControl).TextBoxes[0].Select();

                Assert.AreNotEqual(rtfOriginal, entryViewControl.RtfContentsOfPreviewForTests);
            }
        }
Exemplo n.º 29
0
        protected override void AddWidgetsAfterGhostTrigger(PalasoDataObject wsdo, Control refControl, bool doGoToNextField)
        {
            DetailList.SuspendLayout();
            base.AddWidgetsAfterGhostTrigger(wsdo, refControl, doGoToNextField);
            // We need to update the label on the ghost slice, either adding a number to the end
            // or incrementing the number at the end.
            var position = DetailList.GetCellPosition(refControl);
            var label    = DetailList.GetLabelControlFromRow(position.Row);

            Debug.Assert(label != null);
            Match match = Regex.Match(label.Text, @"(^.*) ([0-9]+)$");
            int   n;

            // Note that Regex Groups have 1-based indexing.
            if (match.Success && Int32.TryParse(match.Groups[2].Value, out n))
            {
                label.Text = String.Format("{0} {1}", match.Groups[1].Value, n + 1);
            }
            else
            {
                label.Text = label.Text + @" 2";
            }
            DetailList.ResumeLayout();
        }
        public CountViewModel(int?id, string user)
        {
            Items.Clear();
            Details.Clear();
            DetailList.Clear();

            countServices = new CountServices();
            syncServices  = new SyncServices();



            if (id == null)
            {
                AsyncLoadItems(); //LoadItems();
            }
            else
            {
                IdPlan = (int)id;
                AsyncLoadDetailsPlan();
            }
            //LoadDetailsPlan((int)id);

            User = user;
        }
Exemplo n.º 31
0
 public void Setup()
 {
     _control = new DetailList();
     //Application.Init();
 }