本文整理汇总了C#中SchemaType类的典型用法代码示例。如果您正苦于以下问题:C# SchemaType类的具体用法?C# SchemaType怎么用?C# SchemaType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SchemaType类属于命名空间,在下文中一共展示了SchemaType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WfOguObject
/// <summary>
///
/// </summary>
/// <param name="obj"></param>
protected WfOguObject(IOguObject obj, SchemaType st)
{
ExceptionHelper.FalseThrow<ArgumentNullException>(obj != null, "obj");
this.id = obj.ID;
this.baseObject = obj;
this.objectType = st;
}
示例2: FillSchema
public override DataTable[] FillSchema(DataSet dataSet, SchemaType schemaType)
{
if (SelectCommand != null)
{
InnerDataAdapter.SelectCommand = RetrieveBaseType(SelectCommand);
}
return InnerDataAdapter.FillSchema(dataSet, schemaType);
}
示例3: Parser
public Parser(SchemaType schemaType, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler) {
this.schemaType = schemaType;
this.nameTable = nameTable;
this.schemaNames = schemaNames;
this.eventHandler = eventHandler;
this.xmlResolver = new XmlUrlResolver();
processMarkup = true;
dummyDocument = new XmlDocument();
}
示例4: Parser
public Parser(SchemaType schemaType, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler) {
this.schemaType = schemaType;
this.nameTable = nameTable;
this.schemaNames = schemaNames;
this.eventHandler = eventHandler;
this.xmlResolver = System.Xml.XmlConfiguration.XmlReaderSection.CreateDefaultResolver();
processMarkup = true;
dummyDocument = new XmlDocument();
}
示例5: FillSchema
public override DataTable[] FillSchema(DataSet dataSet, SchemaType schemaType)
{
if (SelectCommand != null)
{
InnerDataAdapter.SelectCommand = ((GlimpseDbCommand)SelectCommand).Inner;
}
return InnerDataAdapter.FillSchema(dataSet, schemaType);
}
示例6: Parser
public Parser(SchemaType schemaType, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler)
{
_schemaType = schemaType;
_nameTable = nameTable;
_schemaNames = schemaNames;
_eventHandler = eventHandler;
_xmlResolver = null;
_processMarkup = true;
_dummyDocument = new XmlDocument();
}
示例7: CheckSchemaRoot
private bool CheckSchemaRoot(SchemaType rootType, out string code)
{
code = null;
if (this.schemaType == SchemaType.None)
{
this.schemaType = rootType;
}
switch (rootType)
{
case SchemaType.None:
case SchemaType.DTD:
code = "Sch_SchemaRootExpected";
if (this.schemaType == SchemaType.XSD)
{
code = "Sch_XSDSchemaRootExpected";
}
return false;
case SchemaType.XDR:
if (this.schemaType != SchemaType.XSD)
{
if (this.schemaType != SchemaType.XDR)
{
code = "Sch_MixSchemaTypes";
return false;
}
break;
}
code = "Sch_XSDSchemaOnly";
return false;
case SchemaType.XSD:
if (this.schemaType == SchemaType.XSD)
{
break;
}
code = "Sch_MixSchemaTypes";
return false;
}
return true;
}
示例8: ExtractOguObject
protected virtual void ExtractOguObject(IDictionary<string, object> dictionary, out SchemaType oguType, out OguBase result)
{
string id = (string)dictionary["id"];
oguType = SchemaType.Users;
if (dictionary.ContainsKey("objectType"))
oguType = (SchemaType)dictionary["objectType"];
result = CreateOguObject(oguType, id);
result.Description = DictionaryHelper.GetValue(dictionary, "description", string.Empty);
result.DisplayName = DictionaryHelper.GetValue(dictionary, "displayName", string.Empty);
result.FullPath = DictionaryHelper.GetValue(dictionary, "fullPath", string.Empty);
result.GlobalSortID = DictionaryHelper.GetValue(dictionary, "globalSortID", string.Empty);
result.Name = DictionaryHelper.GetValue(dictionary, "name", string.Empty);
result.SortID = DictionaryHelper.GetValue(dictionary, "sortID", string.Empty);
result.Tag = DictionaryHelper.GetValue(dictionary, "tag", string.Empty);
result.ClientContext = DictionaryHelper.GetValue(dictionary, "clientContext", (Dictionary<string, object>)null);
if (dictionary.ContainsKey("status"))
result.Properties["STATUS"] = DictionaryHelper.GetValue(dictionary, "status", 1);
}
示例9: GetSetter
private static OguAndADObjectSetterBase GetSetter(ObjectModifyType modifyType, SchemaType schemaType)
{
string schemaTypeName = schemaType.ToString();
string cacheKey = "OguAndADObjectSetterBase" + "-" + modifyType.ToString() + "+" + schemaTypeName;
return (OguAndADObjectSetterBase)ObjectContextCache.Instance.GetOrAddNewValue(cacheKey, (cache, key) =>
{
SchemaMappingInfo mappingInfo = PermissionCenterToADSynchronizeSettings.GetConfig().SchemaMappings.GetSchemaMappingInfo(schemaTypeName);
OguAndADObjectSetterBase setter = null;
if (mappingInfo.ModifyOperations.ContainsKey(modifyType.ToString()))
{
SetterObjectMappingConfigurationElement objSetterMappingElement = mappingInfo.ModifyOperations[modifyType.ToString()];
setter = (OguAndADObjectSetterBase)PropertySettersSettings.GetConfig().ObjectSetters[objSetterMappingElement.OperationName].CreateInstance();
}
cache.Add(cacheKey, setter);
return setter;
});
}
示例10: CreateObject
/// <summary>
/// 创建机构人员组对象
/// </summary>
/// <param name="type">需要创建的对象类型</param>
/// <returns></returns>
public IOguObject CreateObject(SchemaType type)
{
OguBaseImpl oBase = null;
switch (type)
{
case SchemaType.Users:
oBase = new OguUserImpl();
break;
case SchemaType.Organizations:
oBase = new OguOrganizationImpl();
break;
case SchemaType.OrganizationsInRole:
oBase = new OguOrganizationInRoleImpl();
break;
case SchemaType.Groups:
oBase = new OguGroupImpl();
break;
default:
throw new InvalidOperationException(string.Format(Resource.InvalidObjectTypeCreation, type.ToString()));
}
return oBase;
}
示例11: SetupSchema
internal string SetupSchema (SchemaType schemaType, string sourceTableName)
{
DataTableMapping tableMapping = null;
if (schemaType == SchemaType.Mapped) {
tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction (TableMappings, sourceTableName, sourceTableName, MissingMappingAction);
if (tableMapping != null)
return tableMapping.DataSetTable;
return null;
} else
return sourceTableName;
}
示例12: SchemaMapping
internal SchemaMapping(DataAdapter adapter, DataSet dataset, System.Data.DataTable datatable, DataReaderContainer dataReader, bool keyInfo, SchemaType schemaType, string sourceTableName, bool gettingData, DataColumn parentChapterColumn, object parentChapterValue)
{
MissingMappingAction missingMappingAction;
MissingSchemaAction missingSchemaAction;
this._dataSet = dataset;
this._dataTable = datatable;
this._adapter = adapter;
this._dataReader = dataReader;
if (keyInfo)
{
this._schemaTable = dataReader.GetSchemaTable();
}
if (adapter.ShouldSerializeFillLoadOption())
{
this._loadOption = adapter.FillLoadOption;
}
else if (adapter.AcceptChangesDuringFill)
{
this._loadOption = (LoadOption) 4;
}
else
{
this._loadOption = (LoadOption) 5;
}
if (SchemaType.Mapped == schemaType)
{
missingMappingAction = this._adapter.MissingMappingAction;
missingSchemaAction = this._adapter.MissingSchemaAction;
if (ADP.IsEmpty(sourceTableName))
{
if (this._dataTable != null)
{
int num2 = this._adapter.IndexOfDataSetTable(this._dataTable.TableName);
if (-1 == num2)
{
switch (missingMappingAction)
{
case MissingMappingAction.Passthrough:
this._tableMapping = new DataTableMapping(this._dataTable.TableName, this._dataTable.TableName);
goto Label_01DB;
case MissingMappingAction.Ignore:
this._tableMapping = null;
goto Label_01DB;
case MissingMappingAction.Error:
throw ADP.MissingTableMappingDestination(this._dataTable.TableName);
}
throw ADP.InvalidMissingMappingAction(missingMappingAction);
}
this._tableMapping = this._adapter.TableMappings[num2];
}
}
else
{
this._tableMapping = this._adapter.GetTableMappingBySchemaAction(sourceTableName, sourceTableName, missingMappingAction);
}
}
else
{
if (SchemaType.Source != schemaType)
{
throw ADP.InvalidSchemaType(schemaType);
}
missingMappingAction = MissingMappingAction.Passthrough;
missingSchemaAction = MissingSchemaAction.Add;
if (!ADP.IsEmpty(sourceTableName))
{
this._tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction(null, sourceTableName, sourceTableName, missingMappingAction);
}
else if (this._dataTable != null)
{
int num = this._adapter.IndexOfDataSetTable(this._dataTable.TableName);
if (-1 != num)
{
this._tableMapping = this._adapter.TableMappings[num];
}
else
{
this._tableMapping = new DataTableMapping(this._dataTable.TableName, this._dataTable.TableName);
}
}
}
Label_01DB:
if (this._tableMapping != null)
{
if (this._dataTable == null)
{
this._dataTable = this._tableMapping.GetDataTableBySchemaAction(this._dataSet, missingSchemaAction);
}
if (this._dataTable != null)
{
this._fieldNames = GenerateFieldNames(dataReader);
if (this._schemaTable == null)
{
this._readerDataValues = this.SetupSchemaWithoutKeyInfo(missingMappingAction, missingSchemaAction, gettingData, parentChapterColumn, parentChapterValue);
return;
}
this._readerDataValues = this.SetupSchemaWithKeyInfo(missingMappingAction, missingSchemaAction, gettingData, parentChapterColumn, parentChapterValue);
}
//.........这里部分代码省略.........
示例13: CheckSchemaRoot
private bool CheckSchemaRoot(SchemaType rootType, out string code)
{
code = null;
if (_schemaType == SchemaType.None)
{
_schemaType = rootType;
}
switch (rootType)
{
case SchemaType.XSD:
if (_schemaType != SchemaType.XSD)
{
code = SR.Sch_MixSchemaTypes;
return false;
}
break;
case SchemaType.XDR:
if (_schemaType == SchemaType.XSD)
{
code = SR.Sch_XSDSchemaOnly;
return false;
}
else if (_schemaType != SchemaType.XDR)
{
code = SR.Sch_MixSchemaTypes;
return false;
}
break;
case SchemaType.DTD: //Did not detect schema type that can be parsed by this parser
case SchemaType.None:
code = SR.Sch_SchemaRootExpected;
if (_schemaType == SchemaType.XSD)
{
code = SR.Sch_XSDSchemaRootExpected;
}
return false;
default:
Debug.Assert(false);
break;
}
return true;
}
示例14: FillSchema
public abstract DataTable[] FillSchema (DataSet dataSet, SchemaType schemaType);
示例15: FillSchema
protected virtual DataTable[] FillSchema(DataSet dataSet, SchemaType schemaType, IDbCommand command, string srcTable, CommandBehavior behavior)
{
long logScopeId = DataCommonEventSource.Log.EnterScope("<comm.DbDataAdapter.FillSchema|API> {0}, dataSet, schemaType, command, srcTable, behavior={1}", ObjectID, behavior);
try
{
if (null == dataSet)
{
throw ADP.ArgumentNull(nameof(dataSet));
}
if ((SchemaType.Source != schemaType) && (SchemaType.Mapped != schemaType))
{
throw ADP.InvalidSchemaType(schemaType);
}
if (string.IsNullOrEmpty(srcTable))
{
throw ADP.FillSchemaRequiresSourceTableName(nameof(srcTable));
}
if (null == command)
{
throw ADP.MissingSelectCommand(ADP.FillSchema);
}
return (DataTable[])FillSchemaInternal(dataSet, null, schemaType, command, srcTable, behavior);
}
finally
{
DataCommonEventSource.Log.ExitScope(logScopeId);
}
}