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

C# Placement类代码示例

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

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



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

示例1: CreateDataWithBackupServer

 //[TestCase(false)]
 public void CreateDataWithBackupServer(bool useServerSession)
 {
   int loops = 30000;
   UInt16 objectsPerPage = 300;
   UInt16 pagesPerDatabase = 65000;
   int j;
   if (Directory.Exists(backupDir))
     Directory.Delete(backupDir, true); // remove systemDir from prior runs and all its databases.
   Directory.CreateDirectory(backupDir);
   using (SessionBase session = useServerSession ? (SessionBase)new ServerClientSession(systemDir) : (SessionBase)new SessionNoServer(systemDir))
   {
     Placement place = new Placement(11, 1, 1, objectsPerPage, pagesPerDatabase);
     Man aMan = null;
     Woman aWoman = null;
     const bool isBackupLocation = true;
     session.BeginUpdate();
     // we need to have backup locations special since server is not supposed to do encryption or compression
     DatabaseLocation backupLocation = new DatabaseLocation(Dns.GetHostName(), backupDir, backupLocationStartDbNum, UInt32.MaxValue, session,
       PageInfo.compressionKind.None, PageInfo.encryptionKind.noEncryption, isBackupLocation, session.DatabaseLocations.Default());
     session.NewLocation(backupLocation);
     for (j = 1; j <= loops; j++)
     {
       aMan = new Man(null, aMan, DateTime.Now);
       aMan.Persist(place, session);
       aWoman = new Woman(aMan, aWoman);
       aWoman.Persist(place, session);
       aMan.m_spouse = new WeakIOptimizedPersistableReference<VelocityDbSchema.Person>(aWoman);               
       if (j % 1000000 == 0)
         Console.WriteLine("Loop # " + j);
     }
     UInt64 id = aWoman.Id;
     Console.WriteLine("Commit, done Loop # " + j);
     session.Commit();
   }
 }
开发者ID:MerlinBrasil,项目名称:VelocityDB,代码行数:36,代码来源:BackupRestoreTests.cs


示例2: hashCodeComparerStringTest

 public void hashCodeComparerStringTest()
 {
   Oid id;
   using (SessionNoServer session = new SessionNoServer(systemDir))
   {
     Placement place = new Placement(223, 1, 1, UInt16.MaxValue, UInt16.MaxValue);
     session.Compact();
     session.BeginUpdate();
     HashCodeComparer<string> hashCodeComparer = new HashCodeComparer<string>();
     BTreeSet<string> bTree = new BTreeSet<string>(hashCodeComparer, session);
     bTree.Persist(place, session);
     id = bTree.Oid;
     for (int i = 0; i < 100000; i++)
     {
       bTree.Add(i.ToString());
     }
     session.Commit();
   }
   using (SessionNoServer session = new SessionNoServer(systemDir))
   {
     session.BeginRead();
     BTreeSet<string> bTree= (BTreeSet<string>)session.Open(id);
     int count = 0;
     foreach (string str in bTree)
     {
       count++;
     }
     Assert.True(100000 == count);
     session.Commit();
   }
 }
开发者ID:MerlinBrasil,项目名称:VelocityDB,代码行数:31,代码来源:BTreeTest.cs


示例3: schemaUpdateMultipleSessions

 public void schemaUpdateMultipleSessions()
 {
   using (ServerClientSession session = new ServerClientSession(systemDir))
   {
     session.BeginUpdate();
     Placement place = new Placement(555, 1, 1, 10, 10);
     Simple1 s1 = new Simple1(1);
     s1.Persist(place, session);
     s1 = null;
     using (ServerClientSession session2 = new ServerClientSession(systemDir))
     {
       Placement place2 = new Placement(556, 1, 1, 10, 10);
       session2.BeginUpdate();
       Simple2 s2 = new Simple2(2);
       s2.Persist(place2, session2);
       s2 = null;
       session.Commit();
       session2.Commit(); // optemistic locking will fail due to session2 working with a stale schema (not the one updated by session 1)
       session.BeginUpdate();
       s1 = (Simple1)session.Open(555, 1, 1, false);
       s2 = (Simple2)session.Open(556, 1, 1, false);
       session.Commit();
       session2.BeginUpdate();
       s1 = (Simple1)session2.Open(555, 1, 1, false);
       s2 = (Simple2)session2.Open(556, 1, 1, false);
       session2.Commit();
     }
   }
 }
开发者ID:MerlinBrasil,项目名称:VelocityDB,代码行数:29,代码来源:SchemaTests.cs


示例4: aaaFakeLicenseDatabase

 public void aaaFakeLicenseDatabase()
 {
   Assert.Throws<NoValidVelocityDBLicenseFoundException>(() =>
   {
     using (SessionNoServer session = new SessionNoServer(systemDir))
     {
       session.BeginUpdate();
       Database database;
       License license = new License("Mats", 1, null, null, null, 99999, DateTime.MaxValue, 9999, 99, 9999);
       Placement placer = new Placement(License.PlaceInDatabase, 1, 1, 1);
       license.Persist(placer, session);
       for (uint i = 10; i < 20; i++)
       {
         database = session.NewDatabase(i);
         Assert.NotNull(database);
       }
       session.Commit();
       File.Copy(Path.Combine(systemDir, "20.odb"), Path.Combine(systemDir, "4.odb"));
       session.BeginUpdate();
       for (uint i = 21; i < 30; i++)
       {
         database = session.NewDatabase(i);
         Assert.NotNull(database);
       }
       session.RegisterClass(typeof(VelocityDbSchema.Samples.Sample1.Person));
       Graph g = new Graph(session);
       session.Persist(g);
       session.Commit();
     }
   });
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:31,代码来源:ADatabaseIteration.cs


示例5: TestCreatePlacements

    public void TestCreatePlacements() {
      TestUtils utils = new TestUtils();
      Placement placement1 = new Placement();
      placement1.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp());
      placement1.description = "Contains ad units that can hold creatives of size 300x250";
      placement1.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id};

      Placement placement2 = new Placement();
      placement2.name = string.Format("Medium Square AdUnit Placement #{0}", utils.GetTimeStamp());
      placement2.description = "Contains ad units that can hold creatives of size 300x250";
      placement2.targetedAdUnitIds = new string[] {adUnit1.id, adUnit2.id};

      Placement[] newPlacements = null;

      Assert.DoesNotThrow(delegate() {
        newPlacements = placementService.createPlacements(new Placement[] {placement1, placement2});
      });

      Assert.NotNull(newPlacements);
      Assert.AreEqual(newPlacements.Length, 2);

      Assert.NotNull(newPlacements[0]);
      Assert.AreEqual(newPlacements[0].name, placement1.name);
      Assert.AreEqual(newPlacements[0].description, placement1.description);
      Assert.Contains(adUnit1.id, newPlacements[0].targetedAdUnitIds);
      Assert.Contains(adUnit2.id, newPlacements[0].targetedAdUnitIds);

      Assert.NotNull(newPlacements[1]);
      Assert.AreEqual(newPlacements[1].name, placement2.name);
      Assert.AreEqual(newPlacements[1].description, placement2.description);
      Assert.Contains(adUnit1.id, newPlacements[1].targetedAdUnitIds);
      Assert.Contains(adUnit2.id, newPlacements[1].targetedAdUnitIds);
    }
开发者ID:markgmarkg,项目名称:googleads-dotnet-lib,代码行数:33,代码来源:PlacementServiceTests.cs


示例6: Init

 public void Init() {
   TestUtils utils = new TestUtils();
   placementService = (PlacementService) user.GetService(DfpService.v201511.PlacementService);
   adUnit1 = utils.CreateAdUnit(user);
   adUnit2 = utils.CreateAdUnit(user);
   placement = utils.CreatePlacement(user, new string[] {adUnit1.id, adUnit2.id});
 }
开发者ID:markgmarkg,项目名称:googleads-dotnet-lib,代码行数:7,代码来源:PlacementServiceTests.cs


示例7: MainWindow

 public MainWindow()
 {
   InitializeComponent();
   if (Directory.Exists(systemDir))
     Directory.Delete(systemDir, true); // remove systemDir from prior runs and all its databases.
   try
   {
     session = new SessionBase[4];
     thread = new Thread[4];
     session[0] = new SessionNoServer(systemDir, int.Parse(session1LockTimeout.Text));
     session[1] = new SessionNoServer(systemDir, int.Parse(session2LockTimeout.Text));
     session[2] = new SessionNoServer(systemDir, int.Parse(session3LockTimeout.Text));
     session[3] = new SessionNoServer(systemDir, int.Parse(session4LockTimeout.Text));
     session[0].BeginUpdate();
     Placement place = new Placement(10);
     Number number = new Number();
     session[0].Persist(place, number);
     number = new Number(2);
     place = new Placement(11);
     session[0].Persist(place, number);
     number = new Number(3);
     place = new Placement(12);
     session[0].Persist(place, number);
     session[0].Commit();
   }
   catch (Exception ex)
   {
     session1messages.Content = ex.Message;
   }
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:30,代码来源:DatabaseLocking.xaml.cs


示例8: UpdateTowerGUI

    public void UpdateTowerGUI(Placement selectedTower = null)
    {
        Color col;
        float blorbAmount = BlorbManager.Instance.BlorbAmount;
        Placement[] placements = GUIManager.instance.towers.gameObject.GetComponentsInChildren<Placement>();
        foreach (Placement placement in placements)
        {
            if (placement.cost > blorbAmount) {
                col = new Color(0.3f, 0f, 0f);
            }
            else if (placement == selectedTower) {
                continue;
            }
            else  {
                col = new Color(1f, 1f, 1f);
            }

            placement.GetComponent<SpriteRenderer>().color = col;
            placement.transform.parent.GetComponent<SpriteRenderer>().color = col;
        }

        // add health button
        if (blorbAmount < AddHealthButton.cost || Center.Instance.health > 90f) {
            addHealthButton.GetComponent<SpriteRenderer>().color = new Color(0.3f, 0f, 0f);
        } else {
            addHealthButton.GetComponent<SpriteRenderer>().color = new Color(1f, 1f, 1f);
        }
    }
开发者ID:Harmonickey,项目名称:AlexCSPortfolio,代码行数:28,代码来源:GUIManager.cs


示例9: Equipment

 public Equipment(string _name, int a, int d, Placement p, PlayerCharacter pc, string desc)
     : base(_name, pc, desc)
 {
     addAtk = a;
     addDef = d;
     part = p;
     description = desc;
 }
开发者ID:erob2620,项目名称:Space-Wizards,代码行数:8,代码来源:Equipment.cs


示例10: MonsterGroup

		/// <summary>
		/// Creates new monster group.
		/// </summary>
		/// <param name="name"></param>
		/// <param name="puzzle"></param>
		/// <param name="place"></param>
		/// <param name="spawnPosition"></param>
		public MonsterGroup(string name, Puzzle puzzle, PuzzlePlace place, Placement spawnPosition = Placement.Random)
		{
			_monsters = new List<NPC>();

			this.Name = name;
			this.Puzzle = puzzle;
			this.Place = place;
			_spawnPosition = spawnPosition;
		}
开发者ID:tkiapril,项目名称:aura,代码行数:16,代码来源:MonsterGroup.cs


示例11: Run

    /// <summary>
    /// Runs the code example.
    /// </summary>
    /// <param name="user">The AdWords user.</param>
    /// <param name="adGroupId">Id of the ad group to which placements are added.
    /// </param>
    public void Run(AdWordsUser user, long adGroupId) {
      // Get the AdGroupCriterionService.
      AdGroupCriterionService adGroupCriterionService =
          (AdGroupCriterionService) user.GetService(AdWordsService.v201509.AdGroupCriterionService);

      // Create the placement.
      Placement placement1 = new Placement();
      placement1.url = "http://mars.google.com";

      // Create biddable ad group criterion.
      AdGroupCriterion placementCriterion1 = new BiddableAdGroupCriterion();
      placementCriterion1.adGroupId = adGroupId;
      placementCriterion1.criterion = placement1;

      // Create the placement.
      Placement placement2 = new Placement();
      placement2.url = "http://venus.google.com";

      // Create biddable ad group criterion.
      AdGroupCriterion placementCriterion2 = new BiddableAdGroupCriterion();
      placementCriterion2.adGroupId = adGroupId;
      placementCriterion2.criterion = placement2;

      // Create the operations.
      AdGroupCriterionOperation placementOperation1 = new AdGroupCriterionOperation();
      [email protected] = Operator.ADD;
      placementOperation1.operand = placementCriterion1;

      AdGroupCriterionOperation placementOperation2 = new AdGroupCriterionOperation();
      [email protected] = Operator.ADD;
      placementOperation2.operand = placementCriterion2;

      try {
        // Create the placements.
        AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate(
            new AdGroupCriterionOperation[] {placementOperation1, placementOperation2});

        // Display the results.
        if (retVal != null && retVal.value != null) {
          foreach (AdGroupCriterion adGroupCriterion in retVal.value) {
            // If you are adding multiple type of criteria, then you may need to
            // check for
            //
            // if (adGroupCriterion is Placement) { ... }
            //
            // to identify the criterion type.
            Console.WriteLine("Placement with ad group id = '{0}, placement id = '{1}, url = " +
                "'{2}' was created.", adGroupCriterion.adGroupId,
                adGroupCriterion.criterion.id, (adGroupCriterion.criterion as Placement).url);
          }
        } else {
          Console.WriteLine("No placements were added.");
        }
      } catch (Exception e) {
        throw new System.ApplicationException("Failed to create placements.", e);
      }
    }
开发者ID:markgmarkg,项目名称:googleads-dotnet-lib,代码行数:63,代码来源:AddPlacements.cs


示例12: Legend

 /// <summary>
 /// Default constructor.
 /// </summary>
 public Legend()
 {
     xAttach_ = PlotSurface2D.XAxisPosition.Top;
     yAttach_ = PlotSurface2D.YAxisPosition.Right;
     xOffset_ = 10;
     yOffset_ = 1;
     verticalEdgePlacement_ = Placement.Outside;
     horizontalEdgePlacement_ = Placement.Inside;
     neverShiftAxes_ = false;
 }
开发者ID:sevoku,项目名称:nplot-gtk,代码行数:13,代码来源:Legend.cs


示例13: OnPanelClick

		protected override void OnPanelClick (Gdk.EventButton e, Placement placement)
		{
			if (e.TriggersContextMenu ()) {
				CommandEntrySet opset = new CommandEntrySet ();
				opset.AddItem (CommandSystemCommands.ToolbarList);
				Gtk.Menu menu = manager.CreateMenu (opset);
				menu.Popup (null, null, null, 0, e.Time);
			}
			base.OnPanelClick (e, placement);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:10,代码来源:CommandFrame.cs


示例14: TileInfo

        /// <summary>
        /// Constructor containing info for unpinning a tile.
        /// </summary>
        /// <param name="tileId">The Id of the tile to pin.</param>
        /// <param name="anchorElement">The anchor element that the pin request dialog will display next to.</param>
        /// <param name="requestPlacement">The Placement value that tells where the pin request dialog displays in relation to anchorElement.</param>
        public TileInfo(
			string tileId,
			Windows.UI.Xaml.FrameworkElement anchorElement,
			Placement requestPlacement)
        {
            this.TileId = tileId;

            this.AnchorElement = anchorElement;
            this.RequestPlacement = requestPlacement;
        }
开发者ID:brentedwards,项目名称:Charmed,代码行数:16,代码来源:TileInfo.cs


示例15: OnTapped

 protected override void OnTapped(TappedRoutedEventArgs e)
 {
     base.OnTapped(e);
     if (this.ContextMenu != null)
     {
         this.ContextMenu.PlacementTarget = this;
         this.ContextMenu.Placement = this.Placement;
         this.ContextMenu.DataContext = this.DataContext;
         this.ContextMenu.IsOpen = true;
     }
 }
开发者ID:uwe-e,项目名称:BSE.Tunes,代码行数:11,代码来源:DropDownButton.cs


示例16: Create1Root

 public void Create1Root()
 {
   using (SessionNoServer session = new SessionNoServer(systemDir))
   {
     session.BeginUpdate();
     Placement placementRoot = new Placement(IssueTracker.PlaceInDatabase);
     IssueTracker issueTracker = new IssueTracker(10, session);
     User user = new User(null, "[email protected]", "Mats", "Persson", "matspca");
     user.Persist(session, user);
     PermissionScheme permissions = new PermissionScheme(user);
     issueTracker.Permissions = permissions;
     issueTracker.Persist(placementRoot, session);
     session.Commit();
   }
 }
开发者ID:MerlinBrasil,项目名称:VelocityDB,代码行数:15,代码来源:TrackerTests.cs


示例17: Persist

 public override UInt64 Persist(Placement place, SessionBase session, bool persistRefs = true, bool disableFlush = false, Queue<IOptimizedPersistable> toPersist = null)
 {
   if (IsPersistent == false)
   {
     session.RegisterClass(typeof(AspNetIdentity));
     session.RegisterClass(typeof(UserLoginInfoAdapter));
     session.RegisterClass(typeof(IdentityUser));
     session.RegisterClass(typeof(IdentityRole));
     session.RegisterClass(typeof(BTreeMap<string, UserLoginInfoAdapter>));
     session.RegisterClass(typeof(BTreeMap<string, UInt64>));
     session.RegisterClass(typeof(BTreeSet<IdentityUser>));
     session.RegisterClass(typeof(BTreeSet<IdentityRole>));
     return base.Persist(place, session, persistRefs, disableFlush, toPersist);
   }
   return Id;
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:16,代码来源:AspNetIdentity.cs


示例18: Transaction

    public float Transaction(int diff, Vector3 position, Placement selectedTower = null)
    {
        blorbAmount += diff;
        blorbAmountText.text = ((int)blorbAmount).ToString();

        GUIManager.Instance.UpdateTowerGUI(selectedTower);

        if (Mathf.Abs(diff) > 0f) {
            // Add blorb indicator
            GameObject g = ObjectPool.instance.GetObjectForType("BlorbIndicator", true);
            g.transform.position = position;
            g.transform.parent = map;
            BlorbIndicator b = g.GetComponent<BlorbIndicator>();
            b.SetDiff(diff);
        }

        return blorbAmount;
    }
开发者ID:Harmonickey,项目名称:AlexCSPortfolio,代码行数:18,代码来源:BlorbManager.cs


示例19: ToArrowDirection

        public static UIPopoverArrowDirection ToArrowDirection(Placement placement)
        {
            switch(placement)
            {
                case Placement.Above:
                    return UIPopoverArrowDirection.Down;

                case Placement.Below:
                    return UIPopoverArrowDirection.Up;

                case Placement.Left:
                    return UIPopoverArrowDirection.Right;

                case Placement.Right:
                    return UIPopoverArrowDirection.Left;

                default:
                    return UIPopoverArrowDirection.Any;
            }
        }
开发者ID:inthehand,项目名称:Charming,代码行数:20,代码来源:Placement.cs


示例20: DockToolbarPanel

		public DockToolbarPanel (DockToolbarFrame parentFrame, Placement placement)
		{
	//		ResizeMode = ResizeMode.Immediate;
			Placement = placement;
			switch (placement) {
				case Placement.Top:
					this.orientation = Orientation.Horizontal;
					break;
				case Placement.Bottom:
					this.orientation = Orientation.Horizontal;
					break;
				case Placement.Left:
					this.orientation = Orientation.Vertical;
					break;
				case Placement.Right:
					this.orientation = Orientation.Vertical;
					break;
			}
			
			this.parentFrame = parentFrame;
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:21,代码来源:DockToolbarPanel.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# PlacementOperation类代码示例发布时间:2022-05-24
下一篇:
C# PlaceHolder类代码示例发布时间: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