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


C# Region.Clone方法代码示例

本文整理汇总了C#中Region.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Region.Clone方法的具体用法?C# Region.Clone怎么用?C# Region.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Region的用法示例。


在下文中一共展示了Region.Clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GraphicsContainer

	// Constructor, which saves away all of the important information.
	// We assume that the lock on the "graphics" object is held by the caller.
	internal GraphicsContainer(Graphics graphics)
			{
				// Push this container onto the stack.
				this.graphics = graphics;
				next = graphics.stackTop;
				graphics.stackTop = this;

				// Save the graphics state information.
				clip = graphics.Clip;
				if(clip != null)
				{
					clip = clip.Clone();
				}
				compositingMode = graphics.CompositingMode;
				compositingQuality = graphics.CompositingQuality;
				interpolationMode = graphics.InterpolationMode;
				pageScale = graphics.PageScale;
				pageUnit = graphics.PageUnit;
				pixelOffsetMode = graphics.PixelOffsetMode;
				renderingOrigin = graphics.RenderingOrigin;
				smoothingMode = graphics.SmoothingMode;
				textContrast = graphics.TextContrast;
				textRenderingHint = graphics.TextRenderingHint;
				if (graphics.transform == null)
				{
					transform = null;
				}
				else
				{
					transform = Matrix.Clone(graphics.transform);
				}
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:34,代码来源:GraphicsContainer.cs

示例2: Step_20_TestEntityHelper_Generated

        /// <summary>
        /// Test methods exposed by the EntityHelper class.
        /// </summary>
        private void Step_20_TestEntityHelper_Generated()
        {
            using (TransactionManager tm = CreateTransaction())
            {
                mock = CreateMockInstance(tm);

                Region entity = mock.Copy() as Region;
                entity = (Region)mock.Clone();
                Assert.IsTrue(Region.ValueEquals(entity, mock), "Clone is not working");
            }
        }
开发者ID:jdaigle,项目名称:nettiers,代码行数:14,代码来源:RegionTest.generated.cs

示例3: DuplicateToolStripMenuItem_Click

        /****************************************\
         * Duplicate contextMenuItemClick event *
         *    - Duplicate selected region       *
        \****************************************/
        private void DuplicateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (FTPTreeView.SelectedNode != null && FTPTreeView.SelectedNode.Nodes.Count == 0)
            {
                Region duplicatedRegion = new Region();

                /* Create service */
                FTPWebService.ftpSoapClient service = new FTPWebService.ftpSoapClient();

                /* Get region to duplicate */
                Region regionToDuplicate = new Region();
                foreach (Region element in _RegionsList)
                {
                    if (element.Get_RegionName().Equals(FTPTreeView.SelectedNode.Text.ToString())) //if (element.Get_RegionName().Equals(FTPListDataGridView.CurrentCell.Value))
                    {
                        regionToDuplicate = element;
                        break;
                    }
                }

                /* Clone it */
                duplicatedRegion.Clone(regionToDuplicate);
                duplicatedRegion.Set_RegionNameForClone();

                /* Add it to the list of regions */
                _RegionsList.Add(duplicatedRegion);

                /* Add it in DB */
                int serverID = service.Get_server_id(duplicatedRegion.Get_Provider(), duplicatedRegion.Get_FtpHost(), duplicatedRegion.Get_Login(), duplicatedRegion.Get_Password());
                int idFrequency;
                int idDay;
                switch (duplicatedRegion.Get_RecoveryFrequency())
                {
                    case "None": idFrequency = 5; break;
                    case "Daily": idFrequency = 1; break;
                    case "Weekly": idFrequency = 2; break;
                    case "Monthly": idFrequency = 3; break;
                    case "Yearly": idFrequency = 4; break;
                    default: idFrequency = 5; break;
                }
                switch (duplicatedRegion.Get_RecoveryDay())
                {
                    case "None": idDay = 8; break;
                    case "Monday": idDay = 1; break;
                    case "Tuesday": idDay = 2; break;
                    case "Wednesday": idDay = 3; break;
                    case "Thursday": idDay = 4; break;
                    case "Friday": idDay = 5; break;
                    case "Saturday": idDay = 6; break;
                    case "Sunday": idDay = 7; break;
                    default: idDay = 8; break;
                }
                service.Add_region(serverID, duplicatedRegion.Get_RegionName(), duplicatedRegion.Get_FileMask(), duplicatedRegion.Get_TargetDirectory(), idFrequency, idDay);

                /* Refresh List of FTP */
                //FTPListDataGridView.DataSource = null;
                FillFTPTreeView(); //FillFtpListDataGridView();
                FTPTreeView.SelectedNode = null; //FTPListDataGridView.ClearSelection();

                /* Display result */
                KryptonMessageBox.Show("Region Duplicated !", "Cloned",
                     MessageBoxButtons.OK,
                     MessageBoxIcon.Information);

                /* Close service */
                service.Close();
            }
        }
开发者ID:Genjo15,项目名称:FTPManager,代码行数:72,代码来源:FTPManager.cs


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