• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Generic.List类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Collections.Generic.System.Collections.Generic.List的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.Generic.List类的具体用法?C# System.Collections.Generic.List怎么用?C# System.Collections.Generic.List使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



System.Collections.Generic.List类属于System.Collections.Generic命名空间,在下文中一共展示了System.Collections.Generic.List类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetGroupedRelatedItems

        public System.Collections.Generic.List<GroupByCreateTimeAccountItemViewModel> GetGroupedRelatedItems(AccountItem itemCompareTo, bool searchingOnlyCurrentMonthData = true, System.Action<AccountItem> itemAdded = null)
        {
            System.Collections.Generic.List<GroupByCreateTimeAccountItemViewModel> list = new System.Collections.Generic.List<GroupByCreateTimeAccountItemViewModel>();
            IOrderedEnumerable<AccountItem> source = from p in this.GetRelatedItems(itemCompareTo, searchingOnlyCurrentMonthData)
                                                     orderby p.CreateTime descending
                                                     select p;
            if (itemAdded == null)
            {
                itemAdded = delegate(AccountItem ai)
                {
                };
            }

            var dates = (from p in source select p.CreateTime.Date).Distinct<System.DateTime>();

            foreach (var item in dates)
            {
                GroupByCreateTimeAccountItemViewModel agvm = new GroupByCreateTimeAccountItemViewModel(item);

                source.Where(p => p.CreateTime.Date == item.Date).ToList<AccountItem>().ForEach(delegate(AccountItem x)
                {
                    agvm.Add(x);
                    itemAdded(x);
                });
                list.Add(agvm);
            }

            return list;
        }
开发者ID:RukaiYu,项目名称:TinyMoneyManager.WP8,代码行数:29,代码来源:AccountItemViewerViewModel.cs


示例2: smart_split_tests

        public IEnumerable<StringTest> smart_split_tests()
        {
            System.Collections.Generic.List<StringTest> result = new System.Collections.Generic.List<StringTest>();
            result.Add(new StringTest("smart split-01",
                @"This is ""a person\'s"" test.",
                new string[] { "This", "is", @"""a person\'s""", "test." }
            ));

            result.Add(new StringTest("smart split-02",
                @"Another 'person\'s' test.",
                new string[] { "Another", @"'person's'", "test." }
            ));

            result.Add(new StringTest("smart split-03",
                "A \"\\\"funky\\\" style\" test.",
                new string[] { "A", "\"\"funky\" style\"", "test." }
            ));

            result.Add(new StringTest("smart split-04",
                @"A '\'funky\' style' test.",
                new string[] { "A", @"''funky' style'", "test." }
            ));

            return result;
        }
开发者ID:IntranetFactory,项目名称:ndjango,代码行数:25,代码来源:Tests.cs


示例3: SaveChanges

 public override ObjectWithId SaveChanges(bool updateTree)
 {
     DebtActionStatusContent content = new DebtActionStatusContent();
     System.Collections.Generic.List<FasetItem> list = (System.Collections.Generic.List<FasetItem>) this.bsAllActionStatusContents.get_DataSource();
     System.Collections.Generic.List<FasetItem> list2 = (System.Collections.Generic.List<FasetItem>) this.bsAvailableActionStatusContents.get_DataSource();
     System.Collections.Generic.List<FasetItem> list3 = new System.Collections.Generic.List<FasetItem>();
     this.fillStatusContent();
     foreach (FasetItem item in this.availableStatusContent)
     {
         foreach (FasetItem item2 in list2)
         {
             if (item.Id == item2.Id)
             {
                 list3.Add(item);
             }
         }
     }
     foreach (FasetItem item3 in this.availableStatusContent)
     {
         list.Remove(item3);
     }
     foreach (FasetItem item4 in list)
     {
         content.DebtActionStatusId = (int) ((int) this.status.Id);
         content.StatusId = item4.Id;
         content.Created = System.DateTime.Now;
         content.Insert();
     }
     foreach (FasetItem item5 in list3)
     {
         content.Id = content.FindByDebtActionStatusIdAndDebtActionStatusId((int) ((int) this.status.Id), item5.Id).Id;
         content.Delete();
     }
     return content;
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:35,代码来源:DebtActionStatusContentsView.cs


示例4: ChromeOptions_add_one_extension

 public void ChromeOptions_add_one_extension()
 {
     string[] expected = { "SePSX.dll" };
     AddSeChromeExtensionCommand cmdlet =
         //new AddSeChromeExtensionCommandTestFixture();
         WebDriverFactory.Container.Resolve<AddSeChromeExtensionCommand>();
     //AddSeChromeExtensionCommand.UnitTestMode = true;
     cmdlet.InputObject =
         //WebDriverFactory.GetChromeOptions();
         // resolve ChromeOptions
         WebDriverFactory.Container.Resolve<ChromeOptions>();
     cmdlet.ExtensionList =
         expected;
     SeAddChromeExtensionCommand command =
         new SeAddChromeExtensionCommand(cmdlet);
     command.Execute();
     System.Collections.Generic.List<string> listOfArguments =
         new System.Collections.Generic.List<string>();
     listOfArguments.Add(expected[0]);
     ReadOnlyCollection<string> expectedList =
         new ReadOnlyCollection<string>(listOfArguments);
     //Assert.AreEqual(expectedList, (SePSX.CommonCmdletBase.UnitTestOutput[0] as ChromeOptions).Extensions);
     Assert.AreEqual(
         expectedList,
         ((ChromeOptions)(object)PSTestLib.UnitTestOutput.LastOutput[0]).Extensions);
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:26,代码来源:AddSeChromeExtensionCommandTestFixture.cs


示例5: Build

        public static void Build(ref GMapOverlay OverlayOut)
        {
            // Here loop through defined sectors and display them on the map
            foreach (SystemAdaptationDataSet.SectorBorder Sector in SystemAdaptationDataSet.SectorBorderDataSet)
            {
                System.Collections.Generic.List<PointLatLng> SectorPointList = new System.Collections.Generic.List<PointLatLng>();
                foreach (GeoCordSystemDegMinSecUtilities.LatLongClass SectorPoint in Sector.SectorBorderPoints)
                {
                    SectorPointList.Add(new PointLatLng(SectorPoint.GetLatLongDecimal().LatitudeDecimal, SectorPoint.GetLatLongDecimal().LongitudeDecimal));
                }

                // Get sector border display attributes
                DisplayAttributes.DisplayAttributesType SectorBorderDisplayAttribute = DisplayAttributes.GetDisplayAttribute(DisplayAttributes.DisplayItemsType.SectorBorder);

                GMapPolygon SectorPolygon = new GMapPolygon(SectorPointList, Sector.SectorName);
                SectorPolygon.Stroke = new Pen(SectorBorderDisplayAttribute.LineColor, SectorBorderDisplayAttribute.LineWidth);

                Type brushType = typeof(Brushes);

                Brush myBrush = (Brush)brushType.InvokeMember(SectorBorderDisplayAttribute.AreaPolygonColor.Name,
                 BindingFlags.Public | BindingFlags.Static | BindingFlags.GetProperty,
                 null, null, new object[] { });

                SectorPolygon.Fill = myBrush;
                OverlayOut.Polygons.Add(SectorPolygon);

            }
        }
开发者ID:akapetanovic,项目名称:ASTERIX-ANALYSER-and-DATA-DISPLAY,代码行数:28,代码来源:SectorBorderDisplay.cs


示例6: Display_ViewAll

    protected void Display_ViewAll()
    {
        CatalogEntry CatalogManager = new CatalogEntry(m_refContentApi.RequestInformationRef);
        System.Collections.Generic.List<EntryData> entryList = new System.Collections.Generic.List<EntryData>();
        Ektron.Cms.Common.Criteria<EntryProperty> entryCriteria = new Ektron.Cms.Common.Criteria<EntryProperty>();

        entryCriteria.PagingInfo.RecordsPerPage = m_refContentApi.RequestInformationRef.PagingSize;
        entryCriteria.PagingInfo.CurrentPage = _currentPageNumber;

        entryCriteria.AddFilter(EntryProperty.CatalogId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, m_iID);
        entryCriteria.AddFilter(EntryProperty.LanguageId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, m_refContentApi.RequestInformationRef.ContentLanguage);
        entryCriteria.AddFilter(EntryProperty.IsArchived, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, false);
        entryCriteria.AddFilter(EntryProperty.IsPublished, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, true);

        entryCriteria.OrderByDirection = Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending;
        entryCriteria.OrderByField = Util_GetSortColumn();

        switch (m_sPageAction)
        {
            case "browsecrosssell":
            case "browseupsell":
            case "couponselect":

                // If m_sPageAction = "couponselect" Then entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.NotEqualTo, CatalogEntryType.SubscriptionProduct)
                entryList = CatalogManager.GetList(entryCriteria);
                break;

            case "browse":

                long[] IdList = new long[3];

                IdList[0] = Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Product);
                // IdList(1) = Ektron.Cms.Common.EkEnumeration.CatalogEntryType.ComplexProduct
                entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.In, IdList);
                if (excludeId > 0)
                {
                    entryCriteria.AddFilter(EntryProperty.Id, Ektron.Cms.Common.CriteriaFilterOperator.NotEqualTo, excludeId);
                }
                entryList = CatalogManager.GetList(entryCriteria);
                break;

            default:

                pnl_catalogs.Visible = true;
                pnl_viewall.Visible = false;
                System.Collections.Generic.List<CatalogData> catalogList = new System.Collections.Generic.List<CatalogData>();
                catalogList = CatalogManager.GetCatalogList(1, 1);
                Util_ShowCatalogs(catalogList);
                break;

        }

        TotalPagesNumber = System.Convert.ToInt32(entryCriteria.PagingInfo.TotalPages);

        if (TotalPagesNumber > 1) {
            SetPagingUI();
        }

        Populate_ViewCatalogGrid(entryList);
    }
开发者ID:jaytem,项目名称:minGit,代码行数:60,代码来源:itemselection.aspx.cs


示例7: VsServer

        /// <summary>
        /// Start the console server.
        /// </summary>
        /// <param name="args">These are optional arguments.Pass the local ip address of the server as the first argument and the local port as the second argument.</param>
        public VsServer()
        {
            vsClients = new List<ClientManager>();

            vsAppPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase.Remove(0,8));
            vsSettingsFile = Path.Combine(vsAppPath, "server.config");
        }
开发者ID:tdhieu,项目名称:openvss,代码行数:11,代码来源:VsServer.cs


示例8: GetAllForProduct_should_return_active_stockItems_for_product

        public void GetAllForProduct_should_return_active_stockItems_for_product()
        {
            Func<int, string, string, StockItem> createStockItem = (id, size, product) =>
                StockItem.Create(product, size, new DateTime(2011, 2, 20), "[email protected]").SetId(id);

            var stockItems = new System.Collections.Generic.List<StockItem>
            {
                createStockItem(1, "-", "Widget"),
                createStockItem(2, "Error", "Widget"),
                createStockItem(3, "s", "Widget"),
                createStockItem(4, "m", "Widget"),
                createStockItem(5, "l", "Widget"),
                createStockItem(6, "-", "Gadget"),
                createStockItem(7, "Large", "Gadget"),
            };

            stockItems[0].Deactivate(new DateTime(2011, 2, 20), "mike");
            stockItems[1].Deactivate(new DateTime(2011, 2, 20), "mike");

            stockItemRepository.GetAllDelegate = () => stockItems.AsQueryable();

            var returnedItems = stockItemService.GetAllForProduct("Widget");

            returnedItems.Count().ShouldEqual(3);
            returnedItems.First().ShouldBeTheSameAs(stockItems[2]);
            returnedItems.Last().ShouldBeTheSameAs(stockItems[4]);
        }
开发者ID:somlea-george,项目名称:sutekishop,代码行数:27,代码来源:StockItemServiceTests.cs


示例9: startExit

		//Sets the exit of the start tile (selecting a random one inside the bounds).
		public int startExit (Coordinate coordinate)
		{
		
				int res = 0;
				List<int> allExits = new System.Collections.Generic.List<int> ();
				for (int i =1; i<7; i++) {
						allExits.Add (i); 
				}		
		
		
				while (res == 0) {
			
						int randomVal = (int)Mathf.Floor (Random.Range (0, allExits.Count));
						int possibleExit = allExits [randomVal];
						Coordinate possibleFirstTile = getCoordinateFromExit (coordinate, possibleExit);
			
						if (isOnBounds (possibleFirstTile)) {
								res = possibleExit;
						} else {
								allExits.RemoveAt (randomVal);
						}
				} 
		
		
				return res;
		}
开发者ID:PabloA-C,项目名称:HexPuzzle,代码行数:27,代码来源:AuxMethods.cs


示例10: Index

 public ActionResult Index()
 {
     var clients = new System.Collections.Generic.List<Client>
     {
         new Client { Id = 1, Name = "Julio Avellaneda", Email = "[email protected]" },
         new Client { Id = 2, Name = "Juan Torres", Email = "[email protected]" },
         new Client { Id = 3, Name = "Oscar Camacho", Email = "[email protected]" },
         new Client { Id = 4, Name = "Gina Urrego", Email = "[email protected]" },
         new Client { Id = 5, Name = "Nathalia Ramirez", Email = "[email protected]" },
         new Client { Id = 6, Name = "Raul Rodriguez", Email = "[email protected]" },
         new Client { Id = 7, Name = "Johana Espitia", Email = "johana_espitia[email protected]" },
         new Client { Id = 11, Name = "Julio Avellaneda", Email = "[email protected]" },
         new Client { Id = 22, Name = "Juan Torres", Email = "[email protected]" },
         new Client { Id = 33, Name = "Oscar Camacho", Email = "[email protected]" },
         new Client { Id = 42, Name = "Gina Urrego", Email = "[email protected]" },
         new Client { Id = 50, Name = "Nathalia Ramirez", Email = "[email protected]" },
         new Client { Id = 62121, Name = "Raul Rodriguez", Email = "[email protected]" },
         new Client { Id = 721, Name = "Johana Espitia", Email = "[email protected]" },
         new Client { Id = 121, Name = "Julio Avellaneda", Email = "[email protected]" },
         new Client { Id = 221, Name = "Juan Torres", Email = "[email protected]" },
         new Client { Id = 321, Name = "Oscar Camacho", Email = "[email protected]" },
         new Client { Id = 421, Name = "Gina Urrego", Email = "[email protected]" },
         new Client { Id = 521, Name = "Nathalia Ramirez", Email = "[email protected]" },
         new Client { Id = 621, Name = "Raul Rodriguez", Email = "[email protected]" },
         new Client { Id = 72, Name = "Johana Espitia", Email = "[email protected]" }
     };
     return View(clients);
 }
开发者ID:agnihotriketan,项目名称:GridInMvc,代码行数:28,代码来源:HomeController.cs


示例11: Notify

        public void Notify(params object[] args)
        {
            if (args != null && args.Length != 0 && args[0] is EntityEvent)
            {
                BusinessEntity.EntityKey key = ((EntityEvent)args[0]).EntityKey;
                if (!(key == null))
                {
                    Customer customer = key.GetEntity() as Customer;
                    if (PubHelper.IsOrg_Customer2DMS(customer))
                    {
                        bool flag = PubHelper.IsUsedDMSAPI();
                        if (flag)
                        {
                            //if ((customer.CustomerCategoryKey != null && (customer.CustomerCategory.Code == "101007" || customer.CustomerCategory.Code == "101006"))
                            //    || (customer.CustomerCategory != null
                            //        && customer.CustomerCategory.DescFlexField != null
                            //        && customer.CustomerCategory.DescFlexField.PrivateDescSeg1.GetBool()
                            //        )
                            //    )
                            if(
                                PubHelper.IsUpdateDMS(customer)
                                )
                            {
                                try
                                {
                                    SI08ImplService service = new SI08ImplService();
                                    // service.Url = PubHelper.GetAddress(service.Url);
                                    System.Collections.Generic.List<dealerInfoDto> list = new System.Collections.Generic.List<dealerInfoDto>();
                                    dealerInfoDto dto = new dealerInfoDto();
                                    dto.dealerCode = customer.Code;
                                    dto.dealerName = customer.Name;
                                    dto.dealerShortName = customer.ShortName;
                                    dto.companyCode = customer.Code;
                                    dto.companyName = customer.Name;
                                    dto.companyShortName = customer.ShortName;
                                    if (customer.CustomerCategoryKey != null)
                                    {
                                        dto.dealerType = int.Parse(customer.CustomerCategory.Code);
                                    }
                                    dto.actionType = 3;
                                    // status  100201 有效 100202 无效
                                    dto.status = (customer.Effective != null && customer.Effective.IsEffective) ? "100201" : "100202";

                                    list.Add(dto);
                                    dealerInfoDto d = service.Do(list.ToArray());
                                    if (d != null && d.flag == 0)
                                    {
                                        throw new System.ApplicationException(d.errMsg);
                                    }
                                }
                                catch (System.Exception e)
                                {
                                    throw new System.ApplicationException("调用DMS接口错误:" + e.Message);
                                }
                            }
                        }
                    }
                }
            }
        }
开发者ID:HaiBoHan,项目名称:HBHDaYunsy,代码行数:60,代码来源:CustomerDeleted.cs


示例12: RendererUniversal

 public RendererUniversal(Sprite sprite)
     : base(sprite)
 {
     verts =	 new System.Collections.Generic.List<float>();
     colors = new System.Collections.Generic.List<float>();
     uvs = 	 new System.Collections.Generic.List<float>();
 }
开发者ID:JimmyDeemo,项目名称:openfl-psm,代码行数:7,代码来源:RendererUniversal.cs


示例13: SearchStaffNode

 public System.Collections.Generic.List<SearchNodeStaff> SearchStaffNode(string value)
 {
     System.Collections.Generic.List<SearchNodeStaff> result;
     try
     {
         if (!string.IsNullOrEmpty(value))
         {
             System.Collections.Generic.List<Staff> staffList = this.IndexOfStaff(value);
             System.Collections.Generic.List<SearchNodeStaff> nodes = null;
             if (staffList != null && staffList.Count > 0)
             {
                 nodes = new System.Collections.Generic.List<SearchNodeStaff>();
                 foreach (Staff staff in staffList)
                 {
                     SearchNodeStaff node = new SearchNodeStaff(staff);
                     if (node != null)
                     {
                         nodes.Add(node);
                     }
                 }
             }
             result = nodes;
             return result;
         }
     }
     catch (System.Exception e)
     {
         this.logger.Error(e.ToString());
     }
     result = null;
     return result;
 }
开发者ID:super860327,项目名称:firstwpftest,代码行数:32,代码来源:SearchUtil.cs


示例14: ListFileDlg

        public ListFileDlg(EnvDTE80.DTE2 dte,RecordHandler rec)
        {
            InitializeComponent();
            //�����ļ���ַ
            txt_FilePath.Text = RecordHandler.GetValueFromRegistry();

            _manuallySettingSelection = false;
            _dte = dte;
            _fileNames = new System.Collections.Generic.List<ProjectItemInfo>();
            foreach (EnvDTE.Project project in _dte.Solution.Projects)
            {
                WalkProject(project.ProjectItems);
            }

            LogTimer.Interval = 2000;
            LogTimer.Tick += new EventHandler(LogTimer_Tick);

            RecordTable = initRecordTable();
            initProjectSelector();
            btn_ReadRecordCurProject_Click(null, null);

            de_begin.DateTime = DateTime.Today;
            de_end.DateTime = DateTime.Today;

            recHandler = rec;
        }
开发者ID:Ember213021,项目名称:VS8Plugin,代码行数:26,代码来源:ListFileDlg.cs


示例15: TestAlbersProjection

		public void TestAlbersProjection()
		{
			CoordinateSystemFactory cFac = new SharpMap.CoordinateSystems.CoordinateSystemFactory();

			IEllipsoid ellipsoid = cFac.CreateFlattenedSphere("Clarke 1866", 6378206.4, 294.9786982138982, LinearUnit.USSurveyFoot);

			IHorizontalDatum datum = cFac.CreateHorizontalDatum("Clarke 1866", DatumType.HD_Geocentric, ellipsoid, null);
			IGeographicCoordinateSystem gcs = cFac.CreateGeographicCoordinateSystem("Clarke 1866", AngularUnit.Degrees, datum,
				PrimeMeridian.Greenwich, new AxisInfo("Lon", AxisOrientationEnum.East),
				new AxisInfo("Lat", AxisOrientationEnum.North));
			System.Collections.Generic.List<ProjectionParameter> parameters = new System.Collections.Generic.List<ProjectionParameter>(5);
			parameters.Add(new ProjectionParameter("central_meridian", -96));
			parameters.Add(new ProjectionParameter("latitude_of_center", 23));
			parameters.Add(new ProjectionParameter("standard_parallel_1", 29.5));
			parameters.Add(new ProjectionParameter("standard_parallel_2", 45.5));
			parameters.Add(new ProjectionParameter("false_easting", 0));
			parameters.Add(new ProjectionParameter("false_northing", 0));
			IProjection projection = cFac.CreateProjection("Albers Conical Equal Area", "albers", parameters);

			IProjectedCoordinateSystem coordsys = cFac.CreateProjectedCoordinateSystem("Albers Conical Equal Area", gcs, projection, LinearUnit.Metre, new AxisInfo("East", AxisOrientationEnum.East), new AxisInfo("North", AxisOrientationEnum.North));

			ICoordinateTransformation trans = new CoordinateTransformationFactory().CreateFromCoordinateSystems(gcs, coordsys);

			double[] pGeo = new double[] { -75, 35 };
			double[] pUtm = trans.MathTransform.Transform(pGeo);
			double[] pGeo2 = trans.MathTransform.Inverse().Transform(pUtm);

			double[] expected = new double[] { 1885472.7, 1535925 };
			Assert.IsTrue(ToleranceLessThan(pUtm, expected, 0.05), String.Format("Albers forward transformation outside tolerance, Expected {0}, got {1}", expected.ToString(), pUtm.ToString()));
			Assert.IsTrue(ToleranceLessThan(pGeo, pGeo2, 0.0000001), String.Format("Albers reverse transformation outside tolerance, Expected {0}, got {1}", pGeo.ToString(), pGeo2.ToString()));
		}
开发者ID:diegowald,项目名称:intellitrack,代码行数:31,代码来源:CoordinateTransformTests.cs


示例16: TheTVDB

        public TheTVDB(FileInfo loadFrom, FileInfo cacheFile, CommandLineArgs args)
        {
            Args = args;

            System.Diagnostics.Debug.Assert(cacheFile != null);
            this.CacheFile = cacheFile;

            this.LastError = "";
            // this.WhoHasLock = new List<String>();
            this.Connected = false;
            this.ExtraEpisodes = new System.Collections.Generic.List<ExtraEp>();

            this.LanguageList = new System.Collections.Generic.Dictionary<string, string>();
            this.LanguageList["en"] = "English";

            this.XMLMirror = "http://thetvdb.com";
            this.BannerMirror = "http://thetvdb.com";
            this.ZIPMirror = "http://thetvdb.com";

            this.Series = new System.Collections.Generic.Dictionary<int, SeriesInfo>();
            this.New_Srv_Time = this.Srv_Time = 0;

            this.LoadOK = (loadFrom == null) || this.LoadCache(loadFrom);

            this.ForceReloadOn = new System.Collections.Generic.List<int>();
        }
开发者ID:madams74,项目名称:tvrename,代码行数:26,代码来源:TheTVDB.cs


示例17: TestMercator_1SP_Projection

		public void TestMercator_1SP_Projection()
		{
			CoordinateSystemFactory cFac = new SharpMap.CoordinateSystems.CoordinateSystemFactory();

			IEllipsoid ellipsoid = cFac.CreateFlattenedSphere("Bessel 1840", 6377397.155, 299.15281, LinearUnit.Metre);

			IHorizontalDatum datum = cFac.CreateHorizontalDatum("Bessel 1840", DatumType.HD_Geocentric, ellipsoid, null);
			IGeographicCoordinateSystem gcs = cFac.CreateGeographicCoordinateSystem("Bessel 1840", AngularUnit.Degrees, datum,
				PrimeMeridian.Greenwich, new AxisInfo("Lon", AxisOrientationEnum.East),
				new AxisInfo("Lat", AxisOrientationEnum.North));
			System.Collections.Generic.List<ProjectionParameter> parameters = new System.Collections.Generic.List<ProjectionParameter>(5);
			parameters.Add(new ProjectionParameter("latitude_of_origin", 0));
			parameters.Add(new ProjectionParameter("central_meridian", 110));
			parameters.Add(new ProjectionParameter("scale_factor", 0.997));
			parameters.Add(new ProjectionParameter("false_easting", 3900000));
			parameters.Add(new ProjectionParameter("false_northing", 900000));
			IProjection projection = cFac.CreateProjection("Mercator_1SP", "Mercator_1SP", parameters);

			IProjectedCoordinateSystem coordsys = cFac.CreateProjectedCoordinateSystem("Makassar / NEIEZ", gcs, projection, LinearUnit.Metre, new AxisInfo("East", AxisOrientationEnum.East), new AxisInfo("North", AxisOrientationEnum.North));

			ICoordinateTransformation trans = new CoordinateTransformationFactory().CreateFromCoordinateSystems(gcs, coordsys);

			double[] pGeo = new double[] { 120, -3 };
			double[] pUtm = trans.MathTransform.Transform(pGeo);
			double[] pGeo2 = trans.MathTransform.Inverse().Transform(pUtm);

			double[] expected = new double[] { 5009726.58, 569150.82 };
			Assert.IsTrue(ToleranceLessThan(pUtm, expected, 0.02), String.Format("Mercator_1SP forward transformation outside tolerance, Expected {0}, got {1}", expected.ToString(), pUtm.ToString()));
			Assert.IsTrue(ToleranceLessThan(pGeo, pGeo2, 0.0000001), String.Format("Mercator_1SP reverse transformation outside tolerance, Expected {0}, got {1}", pGeo.ToString(), pGeo2.ToString()));
		}
开发者ID:diegowald,项目名称:intellitrack,代码行数:30,代码来源:CoordinateTransformTests.cs


示例18: Insert

 public static OpenXmlPowerToolsDocument Insert(OpenXmlPowerToolsDocument doc, IEnumerable<string> certificateList)
 {
     using (OpenXmlMemoryStreamDocument streamDoc = new OpenXmlMemoryStreamDocument(doc))
     {
         using (Package package = streamDoc.GetPackage())
         {
             foreach (string digitalCertificate in certificateList)
             {
                 X509Certificate x509Certificate = X509Certificate2.CreateFromCertFile(digitalCertificate);
                 PackageDigitalSignatureManager digitalSigntaureManager = new PackageDigitalSignatureManager(package);
                 digitalSigntaureManager.CertificateOption = CertificateEmbeddingOption.InSignaturePart;
                 System.Collections.Generic.List<Uri> partsToSign = new System.Collections.Generic.List<Uri>();
                 //Adds each part to the list, except relationships parts.
                 foreach (PackagePart openPackagePart in package.GetParts())
                 {
                     if (!PackUriHelper.IsRelationshipPartUri(openPackagePart.Uri))
                         partsToSign.Add(openPackagePart.Uri);
                 }
                 List<PackageRelationshipSelector> relationshipSelectors = new List<PackageRelationshipSelector>();
                 //Creates one selector for each package-level relationship, based on id
                 foreach (PackageRelationship relationship in package.GetRelationships())
                 {
                     PackageRelationshipSelector relationshipSelector =
                         new PackageRelationshipSelector(relationship.SourceUri, PackageRelationshipSelectorType.Id, relationship.Id);
                     relationshipSelectors.Add(relationshipSelector);
                 }
                 digitalSigntaureManager.Sign(partsToSign, x509Certificate, relationshipSelectors);
             }
         }
         return streamDoc.GetModifiedDocument();
     }
 }
开发者ID:jecabana,项目名称:Portal-Vanity-Daniel-en-stand-by,代码行数:32,代码来源:DigitalSignatureAccessor.cs


示例19: GetDataFeed

 public System.Collections.Generic.List<DataFeed> GetDataFeed(PricingLibrary.FinancialProducts.IOption option, System.DateTime fromDate)
 {
     System.Collections.Generic.List<DataFeed> result = new System.Collections.Generic.List<DataFeed>() ;
     using (DataBaseDataContext mtdc = new DataBaseDataContext())
     {
         var result1 = (from s in mtdc.HistoricalShareValues where ((option.UnderlyingShareIds.Contains(s.id)) && (s.date >= fromDate)&&(s.date<=option.Maturity)) select s).OrderByDescending(d => d.date).ToList();
         System.DateTime curentdate = result1[result1.Count() - 1].date;
         System.Collections.Generic.Dictionary<String, decimal> priceList = new System.Collections.Generic.Dictionary<String, decimal>();
         for (int i = result1.Count() - 1; i >= 0 ; i--)
         {
             if (result1[i].date==curentdate)
             {
                 priceList.Add(result1[i].id.Trim(), result1[i].value);
             }
             else
             {
                 DataFeed datafeed = new DataFeed(curentdate, priceList);
                 result.Add(datafeed);
                 curentdate = result1[i].date;
                 priceList = new System.Collections.Generic.Dictionary<String, decimal>();
                 priceList.Add(result1[i].id.Trim(), result1[i].value);
             }
             if (i == 0)
             {
                 DataFeed datafeedOut = new DataFeed(curentdate, priceList);
                 result.Add(datafeedOut);
             }
         }
         return result;
     }
 }
开发者ID:muleta33,项目名称:ProjetNET,代码行数:31,代码来源:HistoricalDataFeedProvider.cs


示例20: Display_All

    protected void Display_All()
    {
        System.Collections.Generic.List<TaxClassData> TaxClassList = new System.Collections.Generic.List<TaxClassData>();
        Ektron.Cms.Common.Criteria<TaxClassProperty> criteria = new Ektron.Cms.Common.Criteria<TaxClassProperty>(TaxClassProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending);
        criteria.PagingInfo.RecordsPerPage = m_refContentApi.RequestInformationRef.PagingSize;
        criteria.PagingInfo.CurrentPage = _currentPageNumber;

        TaxClassList = m_refTaxClass.GetList(criteria);

        TotalPagesNumber = System.Convert.ToInt32(criteria.PagingInfo.TotalPages);
        TotalPages.ToolTip = TotalPagesNumber.ToString();

        if (TotalPagesNumber <= 1)
        {
            TotalPages.Visible = false;
            CurrentPage.Visible = false;
            lnkBtnPreviousPage.Visible = false;
            NextPage.Visible = false;
            LastPage.Visible = false;
            FirstPage.Visible = false;
            PageLabel.Visible = false;
            OfLabel.Visible = false;
        }
        else
        {
            lnkBtnPreviousPage.Enabled = true;
            FirstPage.Enabled = true;
            LastPage.Enabled = true;
            NextPage.Enabled = true;
            TotalPages.Visible = true;
            CurrentPage.Visible = true;
            lnkBtnPreviousPage.Visible = true;
            NextPage.Visible = true;
            LastPage.Visible = true;
            FirstPage.Visible = true;
            PageLabel.Visible = true;
            OfLabel.Visible = true;

            TotalPages.Text = (System.Math.Ceiling(Convert.ToDecimal(TotalPagesNumber))).ToString();

            CurrentPage.Text = _currentPageNumber.ToString();
            CurrentPage.ToolTip = CurrentPage.Text;

            if (_currentPageNumber == 1)
            {
                lnkBtnPreviousPage.Enabled = false;
                FirstPage.Enabled = false;
            }
            else if (_currentPageNumber == TotalPagesNumber)
            {
                NextPage.Enabled = false;
                LastPage.Enabled = false;
            }
        }

        dg_viewall.DataSource = TaxClassList;
        dg_viewall.Columns[0].HeaderText = this.GetMessage("generic id");
        dg_viewall.Columns[1].HeaderText = this.GetMessage("generic name");
        dg_viewall.DataBind();
    }
开发者ID:jaytem,项目名称:minGit,代码行数:60,代码来源:taxclass.aspx.cs



注:本文中的System.Collections.Generic.System.Collections.Generic.List类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ObjectModel.ObservableCollection类代码示例发布时间:2022-05-26
下一篇:
C# Generic.Dictionary类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap