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

C# Partition类代码示例

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

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



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

示例1: Cell

        internal Partition part; // the partition containing this cell

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Load a cell from disk into memory.
        /// </summary>
        /// <param name="part">The partition where this cell belongs</param>
        /// <param name="fileName">The name of the file holding the persisted cell</param>
        /// <exception cref="FileFormatException">The cell file is malformed</exception>
        /// <exception cref="EndOfStreamException">The cell file is too short</exception>
        internal Cell(Partition part, string fileName, bool partial)
        {
            this.part = part;
              this.fileName = fileName;
              var fileLength = new FileInfo(fileName).Length;
              using (var br = new BinaryReader(new BufferedStream(new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read)))) {
            this.baseUID   = br.ReadInt64();
            this.epoch     = br.ReadInt32();
            this.numUrls   = br.ReadInt64();
            this.supraUID  = this.baseUID + this.numUrls;

            this.urlCell = new UrlCell(this, br);
            this.linkCell = new LinkCell[2];
            this.linkCell[0] = new LinkCell(this, br);
            this.linkCell[1] = new LinkCell(this, br);

            long numHdrBytes = br.BaseStream.Position;
            this.urlCell.startPos = numHdrBytes;
            this.linkCell[0].startPos = this.urlCell.startPos + this.urlCell.numBytes;
            this.linkCell[1].startPos = this.linkCell[0].startPos + this.linkCell[0].numBytes;
            var expectedSize = numHdrBytes + this.urlCell.numBytes +
              (partial ? 0L : this.linkCell[0].numBytes + this.linkCell[1].numBytes);
            if (fileLength != expectedSize) {
              throw new FileFormatException(fileName + " is wrong size");
            }
              }
        }
开发者ID:pszmyd,项目名称:SHS,代码行数:40,代码来源:Cell.cs


示例2: CheckTerrain

    void CheckTerrain(string id, int res)
    {
        instance = GetComponent<BC2Instance>().instance;
        string terrainLocation = Util.GetField("TerrainAsset", instance).reference;
        if (terrainLocation == "" || terrainLocation == null)
        {
            Util.Log("TerrainAsset is missing from " + instance.guid);
        } else
        {

            string guid = Util.GetGuid(terrainLocation);
            terrainLocation = Util.ClearGUIDString(terrainLocation);
            terrainLoc = terrainLocation;
            partition = Util.LoadPartition(terrainLocation);
            int terrainRes;
            if (res == 0)
            {
                terrainRes = TerrainRes(terrainLocation, guid);
                fullres = terrainRes;
            } else
            {
                terrainRes = res;
            }

            int terrainHeight = TerrainHeight(terrainLocation);

            LoadTerrain(terrainLocation, terrainRes, terrainHeight, id);

        }
    }
开发者ID:Pahkiller,项目名称:Bad-Company-2-Map-Editor,代码行数:30,代码来源:TerrainEntityData.cs


示例3: DiagramsModel

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="partition">Partition where new element is to be created.</param>
 /// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
 public DiagramsModel(Partition partition, params PropertyAssignment[] propertyAssignments)
 	: base(partition, propertyAssignments)
 {
     // listen to events
     this.Store.EventManagerDirectory.ElementAdded.Add(new EventHandler<ElementAddedEventArgs>(OnElementAdded));
     this.Store.EventManagerDirectory.ElementDeleted.Add(new EventHandler<ElementDeletedEventArgs>(OnElementDeleted));
 }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:12,代码来源:DiagramsModel.cs


示例4: CreateNewProcessOverview

        public static void CreateNewProcessOverview(string ProcessName, ProjectItem processFile, ProjectItem diagramFile)
        {
            var store = new Store(typeof(CloudCoreArchitectProcessOverviewDomainModel));
            var partition = new Partition(store);
            var result = new SerializationResult();

            using (Transaction t = store.TransactionManager.BeginTransaction("create new process overview model"))
            {
                try
                {
                    var processOverviewSerializationHelper = CloudCoreArchitectProcessOverviewSerializationHelper.Instance;
                    Architect.ProcessOverview.Process process = processOverviewSerializationHelper.CreateModelHelper(partition);

                    SetProcessOverviewProperties(ProcessName, process);

                    var diagram = processOverviewSerializationHelper.CreateDiagramHelper(partition, process);

                    processOverviewSerializationHelper.SaveModelAndDiagram(result, process, processFile.FileNames[0], diagram, diagramFile.FileNames[0]);

                    AddAssemblyReference(ProcessName, process);

                    t.Commit();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }

        }
开发者ID:Exclr8,项目名称:CloudCore,代码行数:30,代码来源:FileHelper.cs


示例5: DeleteCommand

 public DeleteCommand(Cluster cluster, WritePolicy policy, Key key)
 {
     this.cluster = cluster;
     this.policy = policy;
     this.key = key;
     this.partition = new Partition(key);
 }
开发者ID:vonbv,项目名称:aerospike-client-csharp,代码行数:7,代码来源:DeleteCommand.cs


示例6: Init

        public void Init()
        {
            this.ListUIChildren = new List<UIComponent>();

            Ribbon.HEIGHT = (int)(0.2f * Render.ScreenHeight);
            Rec = new Rectangle(0, 0, (int)Render.ScreenWidth, Ribbon.HEIGHT);
            RecMenuBar = new Rectangle(Ribbon.MARGE + 100, 0, Rec.Width - 100 - Ribbon.MARGE * 2, 30);
            recBackground = new Rectangle(Rec.X, Rec.Y, Rec.Width, (int)((float)Rec.Height * 1.2f));
            vecTime = new Vector2(RecMenuBar.Left + MARGE * 4, RecMenuBar.Top + RecMenuBar.Height / 2 - Render.FontTextSmall.MeasureString("0").Y / 2);

            BPMMeter BPMMeter = new BPMMeter(this, this.UI, GetNewTimeSpan());
            BPMMeter.Init();
            this.ListUIChildren.Add(BPMMeter);

            Partition = new Partition(this, this.UI, GetNewTimeSpan());
            Partition.Init();
            this.ListUIChildren.Add(Partition);

            imgPlay = new ClickableImage(UI, this, GetNewTimeSpan(), "Play", Render.texPlay, Render.texPlay, new Vector2(BPMMeter.Rec.Right + MARGE * 2, Partition.Rec.Y + RecMenuBar.Height / 2 - Render.texPlay.Height / 2));
            imgPause = new ClickableImage(UI, this, GetNewTimeSpan(), "Pause", Render.texPause, Render.texPause, new Vector2(BPMMeter.Rec.Right + MARGE * 2, Partition.Rec.Y + RecMenuBar.Height / 2 - Render.texPause.Height / 2));
            imgPause.Visible = false;
            imgStop = new ClickableImage(UI, this, GetNewTimeSpan(), "Stop", Render.texStop, Render.texStop, new Vector2(BPMMeter.Rec.Right + MARGE * 3 + Render.texPlay.Width, Partition.Rec.Y + RecMenuBar.Height / 2 - Render.texStop.Height / 2));

            imgPlay.ClickImage += new ClickableImage.ClickImageHandler(imgPlay_ClickImage);
            imgPause.ClickImage += new ClickableImage.ClickImageHandler(imgPause_ClickImage);
            imgStop.ClickImage += new ClickableImage.ClickImageHandler(imgStop_ClickImage);

            this.ListUIChildren.Add(imgPlay);
            this.ListUIChildren.Add(imgPause);
            this.ListUIChildren.Add(imgStop);
        }
开发者ID:HaKDMoDz,项目名称:geff,代码行数:31,代码来源:Ribbon.cs


示例7: Partition

 /// <summary>
 /// Copy information from another partition.
 /// </summary>
 /// <param name="other">Partition to copy.</param>
 public Partition(Partition other)
 {
     this.partitionNumber = other.partitionNumber;
     this.size = other.size;
     this.replicas = new List<UNCPathname>();
     this.replicas.AddRange(other.replicas);
 }
开发者ID:knowledgehacker,项目名称:Dryad,代码行数:11,代码来源:partitionedTables.cs


示例8: NodeShape

        public NodeShape(Partition partition, params PropertyAssignment[] propertyAssignments)
        	: base(partition, propertyAssignments)
        {
            bool bHandledSize = false;
            bool bHandledLocation = false;
            bool bHandledAbsoluteLocation = false;

            if (propertyAssignments != null)
                foreach (PropertyAssignment propertyAssignment in propertyAssignments)
                {
                    if (propertyAssignment.PropertyId == NodeShape.SizeDomainPropertyId)
                        bHandledSize = true;
                    else if (propertyAssignment.PropertyId == NodeShape.LocationDomainPropertyId)
                        bHandledLocation = true;
                    else if (propertyAssignment.PropertyId == NodeShape.AbsoluteLocationDomainPropertyId)
                        bHandledAbsoluteLocation = true;
                }

            if (!bHandledSize)
                this.Size = this.DefaultSize;
            if (!bHandledLocation)
                this.Location = PointD.Empty;
            if (!bHandledAbsoluteLocation)
                this.AbsoluteLocation = PointD.Empty;
        }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:25,代码来源:NodeShape.cs


示例9: CreateModelElementForEFObjectType

        private static ModelElement CreateModelElementForEFObjectType(EFObject obj, Partition partition)
        {
            ModelElement modelElement = null;
            var t = obj.GetType();
            if (t == typeof(ConceptualEntityModel))
            {
                modelElement = new EntityDesignerViewModel(partition);
            }
            else if (t == typeof(ConceptualEntityType))
            {
                modelElement = new EntityType(partition);
            }
            else if (t == typeof(ConceptualProperty))
            {
                modelElement = new ScalarProperty(partition);
            }
            else if (t == typeof(ComplexConceptualProperty))
            {
                modelElement = new ComplexProperty(partition);
            }
            else if (t == typeof(Association))
            {
                modelElement = new ViewModel.Association(partition);
            }
            else if (t == typeof(EntityTypeBaseType))
            {
                modelElement = new Inheritance(partition);
            }
            else if (t == typeof(NavigationProperty))
            {
                modelElement = new ViewModel.NavigationProperty(partition);
            }

            return modelElement;
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:35,代码来源:ModelToDesignerModelXRef.cs


示例10: WallCatalogResource

 public WallCatalogResource(int APIversion,
     uint version,
     uint unknown2,
     Common common,
     Wall wallType,
     Partition partitionType,
     PartitionFlagsType partitionFlags,
     VerticalSpan verticalSpanType,
     PartitionsBlockedFlagsType partitionsBlockedFlags,
     PartitionsBlockedFlagsType adjacentPartitionsBlockedFlags,
     PartitionTool partitionToolMode,
     ToolUsageFlagsType toolUsageFlags,
     uint defaultPatternIndex,
     WallThickness wallThicknessType,
     TGIBlockList ltgib)
     : base(APIversion, version, common, ltgib)
 {
     this.unknown2 = unknown2;
     this.wallType = wallType;
     this.partitionType = partitionType;
     this.partitionFlags = partitionFlags;
     this.verticalSpanType = verticalSpanType;
     this.partitionsBlockedFlags = partitionsBlockedFlags;
     this.adjacentPartitionsBlockedFlags = adjacentPartitionsBlockedFlags;
     this.partitionToolMode = partitionToolMode;
     this.toolUsageFlags = toolUsageFlags;
     this.defaultPatternIndex = defaultPatternIndex;
     this.wallThicknessType = wallThicknessType;
 }
开发者ID:dd-dk,项目名称:s3pi,代码行数:29,代码来源:WallCatalogResource.cs


示例11: OnInspectorGUI

    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        MapLoad mapLoad = (MapLoad)target;

        if(GUILayout.Button("Save as " + mapLoad.saveAs))
        {
            mapLoad.Save();
        }
        string path = "Levels/"+mapLoad.mapName;
        string minimapPath;
        if (lastMapName != mapLoad.mapName) {
            if(Util.FileExist("Resources/"+path+".xml")) {
                partition = Util.LoadPartition (path);
                foreach (Field field in Util.GetComplex ("LevelDescription", partition.instance [0]).field) {
                    if (field.name == "MinimapTexture") {
                        minimapPath = Util.ClearGUIDString (field.reference);
                        minimapPath += ".itexture";
                        texture = Util.LoadiTexture (minimapPath);

                    }
                }

            }
                lastMapName = mapLoad.mapName;
        }
        if (texture != null && !Application.isPlaying) {
            GUILayout.Label (texture, GUILayout.Width(EditorGUIUtility.currentViewWidth - 40), GUILayout.Height(EditorGUIUtility.currentViewWidth - 40));
        }
    }
开发者ID:Powback,项目名称:Bad-Company-2-Map-Editor,代码行数:31,代码来源:MapLoadDrawer.cs


示例12: DeletePartition

 public bool DeletePartition(Partition entity)
 {
     if (entity == null) return false;
     _unitOfWork.PartitionRepository.Delete(entity);
     _unitOfWork.Save();
     return true;
 }
开发者ID:FishAbe,项目名称:cats-hub-module,代码行数:7,代码来源:PartitionService.cs


示例13: CreateDiagramHelper

 internal override EntityDesignerDiagram CreateDiagramHelper(Partition diagramPartition, ModelElement modelRoot)
 {
     var evm = modelRoot as EntityDesignerViewModel;
     var diagram = new EntityDesignerDiagram(diagramPartition);
     diagram.ModelElement = evm;
     return diagram;
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:7,代码来源:MicrosoftDataEntityDesignSerializationHelper.cs


示例14: SetUp

        public void SetUp()
        {
            table = Storage.SetUp();

            partition = new Partition(table, "test");
            virtual1  = new Partition(table, "test|123");
            virtual2  = new Partition(table, "test|456");
        }
开发者ID:james-andrewsmith,项目名称:Streamstone,代码行数:8,代码来源:Virtual_partitions.cs


示例15: AsyncExists

 public AsyncExists(AsyncCluster cluster, Policy policy, Key key, ExistsListener listener)
     : base(cluster)
 {
     this.policy = policy;
     this.listener = listener;
     this.key = key;
     this.partition = new Partition(key);
 }
开发者ID:Caldas,项目名称:aerospike-client-csharp,代码行数:8,代码来源:AsyncExists.cs


示例16: Put

 public async Task Put(string key, string value)
 {
     var now = DateTime.UtcNow;
     var versionLevel = new Partition(this.Target, key);
     await Task.WhenAll(
         versionLevel.Put((now.Ticks).ToString("d19"), value),
         this.master.Put(key, value));
 }
开发者ID:richorama,项目名称:ODIN,代码行数:8,代码来源:OdinVersioner.cs


示例17: Process

        public override double Process(Partition p)
        {
            double result = 0;
            for (int i = 0; i < p.ElementsCount; i++)
                result += GetSilhouette(p, p.Set.Elements[i]);

            return result / p.ElementsCount;
        }
开发者ID:svegapons,项目名称:clustering_ensemble_suite,代码行数:8,代码来源:I_SilhouetteWidth.cs


示例18: InitializeSerializationContext

		/// <summary>
		/// Initialize the serialization context on load / save
		/// </summary>
		/// <remarks>We need to supply a model bus for ModelBusReference deserialization to work</remarks>
		protected override void InitializeSerializationContext(Partition partition, SerializationContext serializationContext, bool isLoading)
		{
			Debug.Assert(partition != null, "partition should not be null");
			Debug.Assert(serializationContext != null, "serializationContext should not be null");

			IModelBus modelbus = partition.Store.GetService(typeof(SModelBus)) as IModelBus;
			serializationContext[Microsoft.VisualStudio.Modeling.Integration.ModelBusReferencePropertySerializer.ModelBusLoadContextKey] = modelbus;
		}	
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:12,代码来源:ModelBusReferencesUtilitiesCompat.cs


示例19: AsyncDelete

 public AsyncDelete(AsyncCluster cluster, WritePolicy policy, Key key, DeleteListener listener)
     : base(cluster)
 {
     this.policy = policy;
     this.listener = listener;
     this.key = key;
     this.partition = new Partition(key);
 }
开发者ID:Caldas,项目名称:aerospike-client-csharp,代码行数:8,代码来源:AsyncDelete.cs


示例20: Ext

        public Ext( Device device, MBRPartitionEntry mbr_entry )
        {
            partition = new Partition( device, mbr_entry );
            Byte[] sector = new Byte[ device.SectorSize ];
            partition.Read( sector, 1024, device.SectorSize );

            if ( sector[ 56 ] != 0x53 || sector[ 57 ] != 0xef ) throw new Exception( "Partition is not Ext2/3/4" );

            Utils.LoadLE32( out inode_count,            sector, 0 );
            Utils.LoadLE32( out total_block_count,      sector, 4 );
            Utils.LoadLE32( out reserved_block_count,   sector, 8 );
            Utils.LoadLE32( out free_block_count,       sector, 12 );
            Utils.LoadLE32( out free_inode_count,       sector, 16 );
            Utils.LoadLE32( out first_data_block,       sector, 20 );
            Utils.LoadLE32( out block_size_pow,         sector, 24 );
            Utils.LoadLE32( out blocks_per_group,       sector, 32 );
            Utils.LoadLE32( out inodes_per_group,       sector, 40 );
            Utils.LoadLE16( out minor_revision,         sector, 62 );
            Utils.LoadLE32( out revision,               sector, 76 );
            Utils.LoadLE32( out first_useable_inode,    sector, 84 );
            Utils.LoadLE16( out inode_size,             sector, 88 );
            Utils.LoadLE32( out features_compatible,    sector, 92 );
            Utils.LoadLE32( out features_incompatible,  sector, 96 );
            Utils.LoadLE32( out features_ro_compatible, sector, 100 );
            Utils.LoadLE32( out volume_id[0],           sector, 104 );
            Utils.LoadLE32( out volume_id[1],           sector, 108 );
            Utils.LoadLE32( out volume_id[2],           sector, 112 );
            Utils.LoadLE32( out volume_id[3],           sector, 116 );
            Utils.LoadString( out volume_name, 16,      sector, 120 );
            prealloc_file   = sector[204];
            prealloc_dir    = sector[205];
            Utils.LoadString( out journal_uuid, 16,     sector, 208 );
            Utils.LoadLE32( out journal_inode,          sector, 224 );
            Utils.LoadLE32( out journal_last_orphan,    sector, 232 );
            Utils.LoadLE32( out hash_seed[0],           sector, 236 );
            Utils.LoadLE32( out hash_seed[1],           sector, 240 );
            Utils.LoadLE32( out hash_seed[2],           sector, 244 );
            Utils.LoadLE32( out hash_seed[3],           sector, 248 );
            hash_version    = sector[252];
            Utils.LoadLE32( out first_meta_block_group, sector, 260 );

            ext4 =  ( ( features_ro_compatible & 0x0008 ) != 0 ) ||
                    ( ( features_ro_compatible & 0x0010 ) != 0 ) ||
                    ( ( features_ro_compatible & 0x0020 ) != 0 ) ||
                    ( ( features_ro_compatible & 0x0040 ) != 0 ) ||
                    ( ( features_incompatible & 0x0040 ) != 0 ) ||
                    ( ( features_incompatible & 0x0080 ) != 0 ) ||
                    ( ( features_incompatible & 0x0100 ) != 0 ) ||
                    ( ( features_incompatible & 0x0200 ) != 0 ) ||
                    ( ( features_incompatible & 0x0400 ) != 0 ) ||
                    ( ( features_incompatible & 0x1000 ) != 0 );

            uint block_group_count = ( total_block_count + blocks_per_group-1 )/blocks_per_group;
            for ( uint i=0; i<block_group_count; ++i )
            {
                bg_descriptors.Add( GetGroupDescriptor( i ) );
            }
        }
开发者ID:pbalint,项目名称:Playground,代码行数:58,代码来源:Ext.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# PartitionContext类代码示例发布时间:2022-05-24
下一篇:
C# ParticleSystem类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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