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


C# Models.ModelRoot类代码示例

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


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

示例1: SQLSelectStoredProcedureTemplate

 public SQLSelectStoredProcedureTemplate(ModelRoot model, CustomStoredProcedure currentStoredProcedure, bool useSingleFile, StringBuilder grantSB)
     : base(model)
 {
     _currentStoredProcedure = currentStoredProcedure;
     _useSingleFile = useSingleFile;
     _grantSB = grantSB;
 }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:7,代码来源:SQLSelectStoredProcedureTemplate.cs

示例2: NewModelWizardForm

		public NewModelWizardForm(ModelRoot root)
			: this()
		{
			_root = root;
			txtCompanyName.Text = _root.CompanyName;
			txtProjectName.Text = _root.ProjectName;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:7,代码来源:NewModelWizardForm.cs

示例3: GetBody

            public static string GetBody(Table table, ModelRoot model)
            {
                try
                {
                    var allColumns = new List<Column>();
                    foreach (var column in table.GetColumnsFullHierarchy().Where(x => x.Generated).OrderBy(x => x.Name))
                    {
                        if (!(column.DataType == System.Data.SqlDbType.Binary ||
                            column.DataType == System.Data.SqlDbType.Image ||
                            column.DataType == System.Data.SqlDbType.NText ||
                            column.DataType == System.Data.SqlDbType.Text ||
                            column.DataType == System.Data.SqlDbType.Timestamp ||
                            column.DataType == System.Data.SqlDbType.Udt ||
                            column.DataType == System.Data.SqlDbType.VarBinary ||
                            column.DataType == System.Data.SqlDbType.Variant ||
                        column.DataType == System.Data.SqlDbType.Money))
                        {
                            allColumns.Add(column);
                        }
                    }

                    if (allColumns.Count != 0)
                    {
                        return BuildStoredProcedure(table, model, allColumns);
                    }

                    return "";

                }
                catch (Exception ex)
                {
                    throw new Exception(table.DatabaseName + ": Failed on generation of paging select statement", ex);
                }
            }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:34,代码来源:SQLGeneratedBodyHelper.cs

示例4: XSDSchemaTemplate

		public XSDSchemaTemplate(ModelRoot model, string schemaName, string rawFileName, bool droprelations)
			: base(model)
		{
			_rawFileName = rawFileName;
			_schemaName = schemaName;
			_droprelations = droprelations;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:7,代码来源:XSDSchemaTemplate.cs

示例5: SQLStoredProcedureViewAllTemplate

 public SQLStoredProcedureViewAllTemplate(ModelRoot model, CustomView view, bool singleFile, StringBuilder grantSB)
     : base(model)
 {
     _view = view;
     _singleFile = singleFile;
     _grantSB = grantSB;
 }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:7,代码来源:SQLStoredProcedureViewAllTemplate.cs

示例6: GetTableDatabaseName

 public static string GetTableDatabaseName(ModelRoot model, Table table)
 {
     var retval = model.Database.TablePrefix;
     if (!string.IsNullOrEmpty(retval))
         return retval + "_" + table.DatabaseName;
     else
         return table.DatabaseName;
 }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:8,代码来源:Globals.cs

示例7: Populate

		public void Populate(ModelRoot model)
		{
			_model = model;
			_model.PropertyChanged += new PropertyChangedEventHandler(_model_PropertyChanged);
			this.LoadControls();

			#region Hook events
			txtCompanyName.Leave += new EventHandler(txtCompanyName_Leave);
			txtCompanyName.Enter += new EventHandler(txtCompanyName_Enter);
			txtCompanyName.KeyDown += new KeyEventHandler(txtCompanyName_KeyDown);

			txtCopyright.Leave += new EventHandler(txtCopyright_Leave);
			txtCopyright.Enter += new EventHandler(txtCopyright_Enter);
			txtCopyright.KeyDown += new KeyEventHandler(txtCopyright_KeyDown);

			txtDefaultNamespace.Leave += new EventHandler(txtDefaultNamespace_Leave);
			txtDefaultNamespace.Enter += new EventHandler(txtDefaultNamespace_Enter);
			txtDefaultNamespace.KeyDown += new KeyEventHandler(txtDefaultNamespace_KeyDown);

			txtProjectName.Leave += new EventHandler(txtProjectName_Leave);
			txtProjectName.Enter += new EventHandler(txtProjectName_Enter);
			txtProjectName.KeyDown += new KeyEventHandler(txtProjectName_KeyDown);

			txtStoredProcPrefix.Leave += new EventHandler(txtStoredProcPrefix_Leave);
			txtStoredProcPrefix.Enter += new EventHandler(txtStoredProcPrefix_Enter);
			txtStoredProcPrefix.KeyDown += new KeyEventHandler(txtStoredProcPrefix_KeyDown);

			txtVersion.Leave += new EventHandler(txtVersion_Leave);
			txtVersion.Enter += new EventHandler(txtVersion_Enter);
			txtVersion.KeyDown += new KeyEventHandler(txtVersion_KeyDown);

			chkCustomChangeEvents.CheckStateChanged += new EventHandler(chkCustomChangeEvents_CheckStateChanged);
			chkSupprtLegacySearch.CheckStateChanged += new EventHandler(chkSupprtLegacySearch_CheckStateChanged);
			chkTransformNames.CheckStateChanged += new EventHandler(chkTransformNames_CheckStateChanged);
			chkUseUTC.CheckStateChanged += new EventHandler(chkUseUTC_CheckStateChanged);
			#endregion

			#region Setup Tooltips
			toolTip1.SetToolTip(txtCompanyName, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "CompanyName"));
			toolTip1.SetToolTip(txtCopyright, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "Copyright"));
			toolTip1.SetToolTip(txtDefaultNamespace, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "DefaultNamespace"));
			toolTip1.SetToolTip(txtProjectName, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "ProjectName"));
			toolTip1.SetToolTip(txtStoredProcPrefix, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "StoredProcedurePrefix"));
			toolTip1.SetToolTip(txtVersion, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "Version"));
			toolTip1.SetToolTip(chkCustomChangeEvents, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "EnableCustomChangeEvents"));
			toolTip1.SetToolTip(chkSupprtLegacySearch, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "SupportLegacySearchObject"));
			toolTip1.SetToolTip(chkTransformNames, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "TransformNames"));
			toolTip1.SetToolTip(chkUseUTC, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "UseUTCTime"));
			toolTip1.SetToolTip(cboSQLServerType, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "SQLServerType"));
			#endregion

		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:52,代码来源:ModelRootControllerUIControl.cs

示例8: GetSQLCreateTable

        public static string GetSQLCreateTable(ModelRoot model, Table table)
        {
            try
            {
                if (table.TypedTable == TypedTableConstants.EnumOnly)
                    return string.Empty;

                var sb = new StringBuilder();
                var tableName = Globals.GetTableDatabaseName(model, table);

                sb.AppendLine("--CREATE TABLE [" + table.DatabaseName + "]");
                sb.AppendLine("if not exists(select * from sysobjects where name = '" + tableName + "' and xtype = 'U')");
                sb.AppendLine("CREATE TABLE [" + table.GetSQLSchema() + "].[" + tableName + "] (");

                var firstLoop = true;
                foreach (var column in table.GeneratedColumns.OrderBy(x => x.SortOrder))
                {
                    if (!firstLoop) sb.AppendLine(",");
                    else firstLoop = false;
                    sb.Append("\t" + AppendColumnDefinition(column, allowDefault: true, allowIdentity: true));
                }
                AppendModifiedAudit(model, table, sb);
                AppendCreateAudit(model, table, sb);
                AppendTimestamp(model, table, sb);
                AppendTenantField(model, table, sb);

                //Emit PK
                var tableIndex = table.TableIndexList.FirstOrDefault(x => x.PrimaryKey);
                if (tableIndex != null)
                {
                    var indexName = "PK_" + table.DatabaseName.ToUpper();
                    sb.AppendLine(",");
                    sb.AppendLine("\t" + "CONSTRAINT [" + indexName + "] PRIMARY KEY " + (tableIndex.Clustered ? "CLUSTERED" : "NONCLUSTERED"));
                    sb.AppendLine("\t" + "(");
                    sb.AppendLine("\t\t" + Globals.GetSQLIndexField(table, tableIndex));
                    sb.AppendLine("\t" + ")");
                }
                else
                    sb.AppendLine();

                sb.AppendLine(")");
                return sb.ToString();
            }
            catch (Exception ex)
            {
                throw;
            }
        }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:48,代码来源:SQLEmit.cs

示例9: AppendCopyrightInSQL

		public static void AppendCopyrightInSQL(StringBuilder sb, ModelRoot model)
		{
			if (!string.IsNullOrEmpty(model.Copyright))
			{
				sb.AppendLine("--Copyright (c) " + DateTime.Now.Year + " " + model.CompanyName + ", All Rights Reserved");

				var temp = model.Copyright.Replace("\r\n", "\n");
				temp = temp.Replace("\r", "\n");
				temp = temp.Replace("%year%", DateTime.Now.Year.ToString());
				var arr = temp.Split('\n');
				foreach (var s in arr)
				{
					sb.AppendLine("--" + s);
				}
				sb.AppendLine();
			}
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:17,代码来源:GenerationHelper.cs

示例10: ColumnCodeFacadeUpdateForm

		public ColumnCodeFacadeUpdateForm(ReferenceCollection columnCollection, ModelRoot modelRoot, FieldSettingConstants fieldSetting)
			: this()
		{
			_columnCollection = columnCollection;
			_modelRoot = modelRoot;
			_fieldSetting = fieldSetting;

			if (_fieldSetting == FieldSettingConstants.Name)
			{
				this.Text = "Update Field";
			}
			else if (_fieldSetting == FieldSettingConstants.Name)
			{
				this.Text = "Update CodeFacade";
			}

			try
			{
				ModelCacheFile cacheFile = null;
				if (modelRoot != null) cacheFile = new ModelCacheFile(modelRoot.GeneratorProject);
				else cacheFile = new ModelCacheFile(((ModelRoot)columnCollection.Root).GeneratorProject);
				if (!string.IsNullOrEmpty(cacheFile.CodeFacadeSettings))
				{
					var document = new XmlDocument();
					document.LoadXml(cacheFile.CodeFacadeSettings);
					var containerNode = document.DocumentElement.ChildNodes[0];
					optPrefix.Checked = XmlHelper.GetAttributeValue(containerNode, "prefixChecked", optPrefix.Checked);
					txtPrefix.Text = XmlHelper.GetAttributeValue(containerNode, "prefix", txtPrefix.Text);
					chkReplaceText.Checked = XmlHelper.GetAttributeValue(containerNode, "replaceText", chkReplaceText.Checked);
					txtReplaceSource.Text = XmlHelper.GetAttributeValue(containerNode, "replaceSource", txtReplaceSource.Text);
					txtReplaceTarget.Text = XmlHelper.GetAttributeValue(containerNode, "replaceTarget", txtReplaceTarget.Text);
					optUpcase.Checked = XmlHelper.GetAttributeValue(containerNode, "upcase", optUpcase.Checked);
					optUnderscore.Checked = XmlHelper.GetAttributeValue(containerNode, "underscore", optUnderscore.Checked);
					chkSkip2Caps.Checked = XmlHelper.GetAttributeValue(containerNode, "TwoCaps", chkSkip2Caps.Checked);
				}
			}
			catch (Exception ex)
			{
				throw;
			}

			this.UpdateForm();
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:43,代码来源:ColumnCodeFacadeUpdateForm.cs

示例11: AppendFullTemplate

        private void AppendFullTemplate(StringBuilder sb, Table table, ModelRoot model)
        {
            try
            {
                var moduleSuffix = string.Empty;
                if (!string.IsNullOrEmpty(_model.ModuleName))
                    moduleSuffix = _model.ModuleName + "_";

                sb.AppendLine("if exists(select * from sys.objects where name = '" + GetStoredProcedureName(table, model, moduleSuffix) + "' and type = 'P' and type_desc = 'SQL_STORED_PROCEDURE')");
                sb.AppendLine("	drop procedure [" + table.GetSQLSchema() + "].[" + GetStoredProcedureName(table, model, moduleSuffix) + "]");
                sb.AppendLine("GO");
                sb.AppendLine();

                //Just drop the procedure if no CRUD SP
                if (!_model.Database.UseGeneratedCRUD)
                    return;

                sb.AppendLine("CREATE PROCEDURE [" + table.GetSQLSchema() + "].[" + GetStoredProcedureName(table, model, moduleSuffix) + "]");
                sb.AppendLine("(");
                sb.AppendLine(BuildParameterList(table, model));
                sb.AppendLine(")");
                sb.AppendLine("AS");
                sb.AppendLine("SET NOCOUNT OFF;");
                sb.AppendLine();
                sb.Append(SQLGeneratedBodyHelper.SQLInsertBusinessObjectBody(table, model));
                sb.AppendLine("GO");
                sb.AppendLine();
                if (model.Database.GrantExecUser != string.Empty)
                {
                    sb.AppendFormat("GRANT EXECUTE ON [" + table.GetSQLSchema() + "].[{0}] TO [{1}]", GetStoredProcedureName(table, model, moduleSuffix), model.Database.GrantExecUser).AppendLine();
                    sb.AppendLine("GO");
                    sb.AppendLine();
                }

            }
            catch (Exception ex)
            {
                throw;
            }

        }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:41,代码来源:SQLInsertBusinessObjectTemplate.cs

示例12: DatasiteMasterScriptTemplate

		public DatasiteMasterScriptTemplate(ModelRoot model, string templateLocation)
			: base(model)
		{
			_templateLocation = templateLocation;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:5,代码来源:DatasiteMasterScriptTemplate.cs

示例13: ComplexTypesSPExtenderTemplate

		public ComplexTypesSPExtenderTemplate(ModelRoot model, CustomStoredProcedure item)
			: base(model)
		{
			_item = item;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:5,代码来源:ComplexTypesSPExtenderTemplate.cs

示例14: StyleSheetTemplate

		public StyleSheetTemplate(ModelRoot model, string templateLocation)
			: base(model)
		{
			_templateLocation = templateLocation;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:5,代码来源:StyleSheetTemplate.cs

示例15: ViewEntityGeneratedTemplate

 public ViewEntityGeneratedTemplate(ModelRoot model, CustomView currentTable)
     : base(model)
 {
     _item = currentTable;
 }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:5,代码来源:ViewEntityGeneratedTemplate.cs


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