当前位置: 首页>>代码示例>>C#>>正文


C# VisualBasic.Collection类代码示例

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


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

示例1: Start

 public override void Start()
 {
     try
     { 
         if (base.m_ItemsSelecteds.Count > 0)
         {
             using (ISession Sesion = m_SessionFactory.OpenSession())
             {
                 Collection ObjectsFlow = new Collection();
                 foreach (String ID in base.m_ItemsSelecteds)
                 {
                     Parent Entity = (Parent)Sesion.Get(base.m_EntidadSF.NombreClase, ID);
                     Entity.NewInstance = false;
                     ObjectsFlow.Add(Entity);
                 }
                 base.m_ObjectFlow = ObjectsFlow;
                 base.m_ResultProcess = EnumResult.SUCESS;
             }
         }
     }
     catch (Exception ex)
     {
         base.m_ResultProcess = EnumResult.ERROR;
         SoftException.Control(ex);
     }
     base.Start();
 }
开发者ID:eldersontc,项目名称:soft-erp,代码行数:27,代码来源:RecoveryCollection.cs

示例2: Load

 public void Load(Collection[,] StaticMap, string iFilename)
 {
     XmlDocument xmlDocument = new XmlDocument();
       try
       {
     xmlDocument.Load(iFilename);
     XmlElement xmlElement1 = (XmlElement) xmlDocument.SelectSingleNode("//Static_Tiles");
     try
     {
       foreach (XmlElement xmlElement2 in xmlElement1.SelectNodes("Tile"))
       {
     short iTileID = XmlConvert.ToInt16(xmlElement2.GetAttribute("TileID"));
     short num1 = XmlConvert.ToInt16(xmlElement2.GetAttribute("X"));
     short num2 = XmlConvert.ToInt16(xmlElement2.GetAttribute("Y"));
     short iZ = XmlConvert.ToInt16(xmlElement2.GetAttribute("Z"));
     short iHue = XmlConvert.ToInt16(xmlElement2.GetAttribute("Hue"));
     StaticCell staticCell = new StaticCell(iTileID, checked ((byte) unchecked ((int) num1 % 8)), checked ((byte) unchecked ((int) num2 % 8)), iZ, iHue);
     StaticMap[(int) (short) ((int) num1 >> 3), (int) (short) ((int) num2 >> 3)].Add((object) staticCell, (string) null, (object) null, (object) null);
       }
     }
     finally
     {
       IEnumerator enumerator;
       if (enumerator is IDisposable)
     ((IDisposable) enumerator).Dispose();
     }
       }
       catch (Exception ex)
       {
     ProjectData.SetProjectError(ex);
     int num = (int) Interaction.MsgBox((object) ("Can not find:" + iFilename), MsgBoxStyle.OKOnly, (object) null);
     ProjectData.ClearProjectError();
       }
 }
开发者ID:HankTheDrunk,项目名称:ultimaonlinemapcreator,代码行数:34,代码来源:ImportTiles.cs

示例3: Fleet

 public Fleet(byte[] Data)
 {
     this.xShips = new Collection();
     this.Waypoints = new Collection();
     this.WaypointTasks = new Collection();
     this.IncompleteInfo = true;
     this.FleetData = Data;
 }
开发者ID:runholen,项目名称:stars,代码行数:8,代码来源:Fleet.cs

示例4: ImportTiles

 public ImportTiles(Collection[,] StaticMap, string iPath)
 {
     iPath = iPath + "\\Import Files\\";
       if (!Directory.Exists(iPath))
       {
     int num = (int) Interaction.MsgBox((object) "No Import Tiles directory was found.", MsgBoxStyle.OKOnly, (object) null);
       }
       else
     this.ProcessDirectory(StaticMap, iPath);
 }
开发者ID:HankTheDrunk,项目名称:ultimaonlinemapcreator,代码行数:10,代码来源:ImportTiles.cs

示例5: Load

 public long Load(string Filename)
 {
     long num2;
     this.xPlanets = new Collection();
     Decryptor decryptor = new Decryptor();
     int num4 = Strings.InStrRev(Filename, ".m", -1, CompareMethod.Text);
     if (num4 > 0)
     {
         this.PlayerNo = Conversions.ToInteger(Filename.Substring(num4 + 1));
         Filename = Filename.Substring(0, num4 - 1);
     }
     else
     {
         Interaction.MsgBox("A valid .m file must be entered", MsgBoxStyle.ApplicationModal, null);
         return num2;
     }
     this.xyFile = decryptor.OpenFile(Filename + ".xy");
     this.xPlayerCount = this.xyFile[0x1c];
     this.xPlanetCount = this.xyFile[30] + (this.xyFile[0x1f] * 0x100);
     this.xGameName = "";
     int index = 0x34;
     do
     {
         if (this.xyFile[index] == 0)
         {
             break;
         }
         this.xGameName = this.xGameName + Conversions.ToString(Strings.Chr(this.xyFile[index]));
         index++;
     }
     while (index <= 0x53);
     int x = 0x3e8;
     int num9 = this.PlanetCount - 1;
     for (int i = 0; i <= num9; i++)
     {
         Planet item = new Planet(i);
         item.X = (this.xyFile[(0x54 + (i * 4)) + 0] + ((this.xyFile[(0x54 + (i * 4)) + 1] & 3) * 0x100)) + x;
         x = item.X;
         item.Y = (int) Math.Round((double) (Conversion.Int((double) (((double) this.xyFile[(0x54 + (i * 4)) + 1]) / 4.0)) + ((this.xyFile[(0x54 + (i * 4)) + 2] & 0x3f) * 0x40)));
         item.NameID = (int) Math.Round((double) (Conversion.Int((double) (((double) this.xyFile[(0x54 + (i * 4)) + 2]) / 64.0)) + (this.xyFile[(0x54 + (i * 4)) + 3] * 4)));
         this.Planets().Add(item, "ID" + Conversions.ToString(i), null, null);
     }
     this.mFile = decryptor.OpenFile(Filename + ".m" + Conversions.ToString(this.PlayerNo));
     this.hstLoaded = true;
     int hstPosition = 0;
     do
     {
         int num7;
         int num8;
         byte[] data = new byte[0x401];
         this.ReadBlock(this.mFile, ref hstPosition, ref data, ref num8, ref num7);
     }
     while (hstPosition != this.mFile.Length);
     return num2;
 }
开发者ID:stars-4x,项目名称:decompiled,代码行数:55,代码来源:StarsPlayerEditor.cs

示例6: ImportTiles

 public ImportTiles(Collection[,] StaticMap, string iPath)
 {
     iPath = string.Concat(iPath, "\\Import Files\\");
     if (Directory.Exists(iPath))
     {
         this.ProcessDirectory(StaticMap, iPath);
     }
     else
     {
         Interaction.MsgBox("No Import Tiles directory was found.", MsgBoxStyle.OKOnly, null);
     }
 }
开发者ID:HankTheDrunk,项目名称:ultimaonlinemapcreator,代码行数:12,代码来源:ImportTiles.cs

示例7: DatabasesToIgnore

        /// <summary>
        /// 
        /// <remarks></remarks>
        /// </summary>
        /// <returns></returns>
        public static IEnumerable<String> DatabasesToIgnore()
        {
            Collection<String> dbNames = new Collection<String>();

            dbNames.Add("ReportServer");
            dbNames.Add("ReportServerTempDB");
            dbNames.Add("master");
            dbNames.Add("msdb");
            dbNames.Add("model");
            dbNames.Add("tempdb");

            return dbNames;
        }
开发者ID:rexwhitten,项目名称:MGenerator,代码行数:18,代码来源:Generator.cs

示例8: ProcessDirectory

 public void ProcessDirectory(Collection[,] StaticMap, string targetDirectory)
 {
     string[] files = Directory.GetFiles(targetDirectory, "*.xml");
     for (int i = 0; i < (int)files.Length; i++)
     {
         this.Load(StaticMap, files[i]);
     }
     string[] directories = Directory.GetDirectories(targetDirectory);
     for (int j = 0; j < (int)directories.Length; j++)
     {
         this.ProcessDirectory(StaticMap, directories[j]);
     }
 }
开发者ID:HankTheDrunk,项目名称:ultimaonlinemapcreator,代码行数:13,代码来源:ImportTiles.cs

示例9: AddAfterNoKey

        public void AddAfterNoKey()
        {
            Collection c;

            c = new Collection ();

            c.Add (typeof (int), null, null, 0);
            c.Add (typeof (double), null, null, 1);
            c.Add (typeof (string), null, null, 1);
            c.Add (typeof (object), null, null, 3);

            Assert.AreEqual (4, c.Count, "#AANK01");
            Assert.AreEqual (typeof (object), c[4], "#AANK02");
            Assert.AreEqual (typeof (int), c[1], "#AANK03");
            Assert.AreEqual (typeof (string), c[2], "#AANK04");
        }
开发者ID:h-endo12345,项目名称:mono-basic,代码行数:16,代码来源:CollectionTests.cs

示例10: RandomStatics

        public RandomStatics(string iFileName)
        {
            this.m_Random = new Collection();
            XmlDocument xmlDocument = new XmlDocument();
            try
            {
                string filename = string.Format("{0}Data\\Statics\\{1}", AppDomain.CurrentDomain.BaseDirectory, iFileName);
                xmlDocument.Load(filename);
                XmlElement xmlElement = (XmlElement)xmlDocument.SelectSingleNode("//RandomStatics");
                this.m_Freq = (int)XmlConvert.ToInt16(xmlElement.GetAttribute("Chance"));

                IEnumerator enumerator = xmlElement.SelectNodes("Statics").GetEnumerator();

                try
                {
                    while (enumerator.MoveNext())
                    {
                        XmlElement xmlInfo = (XmlElement)enumerator.Current;
                        RandomStaticCollection randomStaticCollection = new RandomStaticCollection(xmlInfo);
                        this.InnerList.Add(randomStaticCollection);
                        if (randomStaticCollection.Freq > 0)
                        {
                            byte arg_AC_0 = 1;
                            byte b = checked((byte)randomStaticCollection.Freq);
                            for (byte b2 = arg_AC_0; b2 <= b; b2 += 1)
                            {
                                this.m_Random.Add(randomStaticCollection, null, null, null);
                            }
                        }
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        ((IDisposable)enumerator).Dispose();
                    }
                }
            }
            catch (Exception expr_F8)
            {
                ProjectData.SetProjectError(expr_F8);
                Interaction.MsgBox("Can not find:" + iFileName, MsgBoxStyle.OkOnly, null);
                ProjectData.ClearProjectError();
            }
        }
开发者ID:HankTheDrunk,项目名称:ultimaonlinemapcreator,代码行数:46,代码来源:RandomStatics.cs

示例11: AddAfterKey

        public void AddAfterKey()
        {
            Collection c;

            c = new Collection ();

            c.Add ("Baseball", "Base", null, 0);
            c.Add ("Football", "Foot", null, 1);
            c.Add ("Basketball", "Basket", null, 1);
            c.Add ("Volleyball", "Volley", null, 2);

            Assert.AreEqual (4, c.Count, "#AAK01");
            Assert.AreEqual ("Baseball", c[1], "#AAK02");
            Assert.AreEqual ("Football", c[4], "#AAK03");
            Assert.AreEqual ("Basketball", c["Basket"], "#AAK04");
            Assert.AreEqual ("Volleyball", c["Volley"], "#AAK05");
        }
开发者ID:h-endo12345,项目名称:mono-basic,代码行数:17,代码来源:CollectionTests.cs

示例12: ContractGenerator

        /// <summary>
        /// Initializes a new instance of the <see cref="T:ProxyGenerator"/> class.
        /// </summary>
        /// <param name="options">The options.</param>
        public ContractGenerator(ContractGenerationOptions options)
        {
            if (!string.IsNullOrEmpty(options.OutputConfigurationFile))
            {
                System.Configuration.Configuration machineConfiguration = ConfigurationManager.OpenMachineConfiguration();
                ExeConfigurationFileMap configurationMap = new ExeConfigurationFileMap();
                configurationMap.ExeConfigFilename = options.OutputConfigurationFile;
                configurationMap.MachineConfigFilename = machineConfiguration.FilePath;
                this.configuration = ConfigurationManager.OpenMappedExeConfiguration(configurationMap, ConfigurationUserLevel.None);
            }
            else if (options.OutputConfiguration != null)
            {
                this.configuration = options.OutputConfiguration;
            }

            this.codeCompileUnit = new CodeCompileUnit();
            this.options = options;
            this.generatedChannelElements = new Collection<ChannelEndpointElement>();
        }
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:23,代码来源:ContractGenerator.cs

示例13: ProcessDirectory

 public void ProcessDirectory(Collection[,] StaticMap, string targetDirectory)
 {
     string[] files = Directory.GetFiles(targetDirectory, "*.xml");
       int index1 = 0;
       while (index1 < files.Length)
       {
     string iFilename = files[index1];
     this.Load(StaticMap, iFilename);
     checked { ++index1; }
       }
       string[] directories = Directory.GetDirectories(targetDirectory);
       int index2 = 0;
       while (index2 < directories.Length)
       {
     string targetDirectory1 = directories[index2];
     this.ProcessDirectory(StaticMap, targetDirectory1);
     checked { ++index2; }
       }
 }
开发者ID:HankTheDrunk,项目名称:ultimaonlinemapcreator,代码行数:19,代码来源:ImportTiles.cs

示例14: RandomStatics

 public RandomStatics(string iFileName)
 {
     IEnumerator enumerator = null;
     this.m_Random = new Collection();
     XmlDocument xmlDocument = new XmlDocument();
     try
     {
         string str = string.Format("{0}Data\\Statics\\{1}", AppDomain.CurrentDomain.BaseDirectory, iFileName);
         xmlDocument.Load(str);
         XmlElement xmlElement = (XmlElement)xmlDocument.SelectSingleNode("//RandomStatics");
         this.m_Freq = XmlConvert.ToInt16(xmlElement.GetAttribute("Chance"));
         try
         {
             enumerator = xmlElement.SelectNodes("Statics").GetEnumerator();
             while (enumerator.MoveNext())
             {
                 RandomStaticCollection randomStaticCollection = new RandomStaticCollection((XmlElement)enumerator.Current);
                 this.InnerList.Add(randomStaticCollection);
                 if (randomStaticCollection.Freq > 0)
                 {
                     byte freq = checked((byte)randomStaticCollection.Freq);
                     for (byte i = 1; i <= freq; i = checked((byte)(i + 1)))
                     {
                         this.m_Random.Add(randomStaticCollection, null, null, null);
                     }
                 }
             }
         }
         finally
         {
             if (enumerator is IDisposable)
             {
                 ((IDisposable)enumerator).Dispose();
             }
         }
     }
     catch (Exception exception)
     {
         ProjectData.SetProjectError(exception);
         Interaction.MsgBox(string.Concat("Can not find:", iFileName), MsgBoxStyle.OKOnly, null);
         ProjectData.ClearProjectError();
     }
 }
开发者ID:HankTheDrunk,项目名称:ultimaonlinemapcreator,代码行数:43,代码来源:RandomStatics.cs

示例15: ProcessDirectory

 public void ProcessDirectory(Collection[,] StaticMap, string targetDirectory)
 {
     string[] files = Directory.GetFiles(targetDirectory, "*.xml");
     string[] array = files;
     checked
     {
         for (int i = 0; i < array.Length; i++)
         {
             string iFilename = array[i];
             this.Load(StaticMap, iFilename);
         }
         string[] directories = Directory.GetDirectories(targetDirectory);
         string[] array2 = directories;
         for (int j = 0; j < array2.Length; j++)
         {
             string targetDirectory2 = array2[j];
             this.ProcessDirectory(StaticMap, targetDirectory2);
         }
     }
 }
开发者ID:HankTheDrunk,项目名称:ultimaonlinemapcreator,代码行数:20,代码来源:ImportTiles.cs


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