本文整理汇总了C#中DataObject类的典型用法代码示例。如果您正苦于以下问题:C# DataObject类的具体用法?C# DataObject怎么用?C# DataObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataObject类属于命名空间,在下文中一共展示了DataObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RetrievePassword
public RegisterDataObject RetrievePassword(DataObject.RegisterDataObject userData)
{
try
{
DataObject.RegisterDataObject Password = BusinessLayer.Accounts.Retrieve(userData);
if (string.IsNullOrEmpty(Password.Password))
{
return new RegisterDataObject();
}
else
{
RegisterDataObject Data = new RegisterDataObject();
Data.AutoId = Password.AutoId;
Data.ConfirmPassword = Password.ConfirmPassword;
Data.EmailId = Password.EmailId;
Data.FullName = Password.FullName;
Data.Guid = Password.Guid;
Data.Password = Password.Password;
Data.UserName = Password.UserName;
return Data;
}
}
catch (Exception ex)
{
MyCustomErrorDetail Error = new MyCustomErrorDetail("Unexpected Error caused by " + ex.Source, ex.Message);
throw new WebFaultException<MyCustomErrorDetail>(Error, System.Net.HttpStatusCode.InternalServerError);
}
}
开发者ID:Rathore25,项目名称:UserApplicationProject-asp.net-mvc4,代码行数:28,代码来源:AccountService.svc.cs
示例2: HandleCompletion
/// <summary>
/// Hande task completion with task output data passed as NameValueCollection
/// </summary>
/// <param name="correlationId"></param>
/// <param name="taskOutputData"></param>
private void HandleCompletion(string correlationId, NameValueCollection taskOutputData)
{
try
{
IApplicationContext ctx = Spring.Context.Support.ContextRegistry.GetContext();
INGEnvironment env = (INGEnvironment)ctx.GetObject("NGEnvironment");
IProcessPackageRepository pdr = (IProcessPackageRepository)ctx.GetObject("PackageRepository");
TaskInstanceInfo ti = env.GetTaskInstanceInfo(correlationId);
NG.ProcessDefinition pd = pdr.GetProcess(ti.ProcessDefinitionId);
NG.Task ntsk = pd.GetTask(ti.TaskId);
StructDef sd = ntsk.GetTaskOutputDataSchema();
DataObject completionData = new DataObject();
foreach (MemberDef md in sd.Members)
{
string s = taskOutputData[md.Name];
if (s != null)
{
completionData[md.Name] = s;
}
}
log.Info("Completing task {0} with data {1}", correlationId, completionData.ToString());
env.ReportTaskFinished(correlationId, completionData, Context.User.Identity.Name);
}
catch (Exception ex)
{
log.Error("Error completing task {0}: {1}", correlationId, ex);
throw;
}
}
开发者ID:alasdairhurst,项目名称:nginn,代码行数:34,代码来源:CompleteTask.aspx.cs
示例3: DataTest
static void DataTest()
{
DataObject dob = new DataObject();
dob["ala"] = "ma kota";
dob["jola"] = "nie ma zielonego pojêcia";
dob["zenek"] = 35;
dob["dziœ"] = DateTime.Now;
dob["ala"] = "ju¿ nie ma kota";
dob["kot"] = new List<string>(new string[] { "skarpeta", "tiger", "filemon", "kuba" });
StringBuilder sb = new StringBuilder();
foreach (string k in dob.Keys)
{
log.Debug("{0}={1}", k, dob[k]);
}
DataObject dob2 = new DataObject((IDataObject) dob);
XmlWriter xw = XmlWriter.Create(sb);
dob2.ToXml("dob2", xw);
xw.Flush();
log.Debug("XML: {0}", sb.ToString());
string xml = "<?xml version=\"1.0\" ?><data id=\"11\"> <member1>aaa</member1> <member1>bbb</member1> <and>\n<otherData>tutaj</otherData>\n<more>...</more></and>\n<member3>\nsome\ntext</member3>\n</data>";
log.Debug("Parsing XML: {0}", xml);
StringReader sr = new StringReader(xml);
XmlReader xr = XmlReader.Create(sr);
xr.MoveToContent();
DataObject dob3 = DataObject.ParseXmlElement(xr);
log.Debug("Result: {0}", dob3.ToXmlString("dob3"));
}
开发者ID:alasdairhurst,项目名称:nginn,代码行数:29,代码来源:Program.cs
示例4: ThrowsException
public void ThrowsException()
{
var dataObject1 = new DataObject
{
Name = "First"
};
var dataObject2 = new DataObject
{
Name = "Second",
Other = dataObject1
};
dataObject1.Other = dataObject2;
Assert.That(dataObject1.Other, Is.SameAs(dataObject2), "Sanity check");
Assert.That(dataObject2.Other, Is.SameAs(dataObject1), "Sanity check");
using (var ms = new MemoryStream())
{
Assert.That(
() => KVSerializer.Serialize(ms, dataObject1, "test data"),
Throws.Exception.InstanceOf<KeyValueException>()
.With.Message.EqualTo("Serialization failed - circular object reference detected."));
}
}
开发者ID:xfw5,项目名称:ValveKeyValue,代码行数:26,代码来源:CircularObjectSerializationTestCase.cs
示例5: CastTo
public override DataObject CastTo(DataObject value, SqlType destType)
{
var bValue = ((SqlBoolean) value.Value);
if (destType is StringType) {
var s = Convert.ToString(bValue);
// TODO: Provide a method in StringType to build a string specific to the type
return new DataObject(destType, new SqlString(s));
}
if (destType is NumericType) {
SqlNumber num;
if (bValue == SqlBoolean.Null) {
num = SqlNumber.Null;
} else if (bValue) {
num = SqlNumber.One;
} else {
num = SqlNumber.Zero;
}
return new DataObject(destType, num);
}
if (destType is BinaryType) {
var bytes = (byte[]) Convert.ChangeType(bValue, typeof (byte[]), CultureInfo.InvariantCulture);
return new DataObject(destType, new SqlBinary(bytes));
}
if (destType is BooleanType)
return value;
return base.CastTo(value, destType);
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:29,代码来源:BooleanType.cs
示例6: createTestVirtualDocument
private void createTestVirtualDocument()
{
// create a new DataObject to use as the parent node
ObjectIdentity emptyIdentity = new ObjectIdentity(DefaultRepository);
DataObject parentDO = new DataObject(emptyIdentity);
parentDO.Type = "dm_document";
PropertySet parentProperties = new PropertySet();
parentProperties.Set("object_name", SampleContentManager.testVdmObjectName);
parentDO.Properties = parentProperties;
// link into a folder
ObjectPath objectPath = new ObjectPath(SampleContentManager.sourcePath);
ObjectIdentity sampleFolderIdentity = new ObjectIdentity(objectPath, DefaultRepository);
ReferenceRelationship sampleFolderRelationship = new ReferenceRelationship();
sampleFolderRelationship.Name = Relationship.RELATIONSHIP_FOLDER;
sampleFolderRelationship.Target = sampleFolderIdentity;
sampleFolderRelationship.TargetRole = Relationship.ROLE_PARENT;
parentDO.Relationships.Add(sampleFolderRelationship);
// get id of document to use for first child node
ObjectIdentity child0Id = new ObjectIdentity();
child0Id.RepositoryName = DefaultRepository;
child0Id.Value = new Qualification(SampleContentManager.gifImageQualString);
// get id of document to use for second child node
ObjectIdentity child1Id = new ObjectIdentity();
child1Id.RepositoryName = DefaultRepository;
child1Id.Value = new Qualification(SampleContentManager.gifImage1QualString);
ObjectIdentitySet childNodes = new ObjectIdentitySet();
childNodes.AddIdentity(child0Id);
childNodes.AddIdentity(child1Id);
virtualDocumentServiceDemo.AddChildNodes(parentDO, childNodes);
}
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:35,代码来源:TVirtualDocumentServiceDemo.cs
示例7: btnTest_Click
protected void btnTest_Click(object sender, EventArgs e)
{
if (ConfigXML.AccessAllow(NTT.Web.Core.Security.Cryto.MD5(this.txt_conf.Text)))
{
//ConfigXML.BuildConfigFile("tmpdbconfig.xml", this.Txt_Server.Text, this.txt_db.Text, this.txt_uid.Text, this.txt_pwd.Text);
StringBuilder sb = new StringBuilder();
sb.Append("Server=").Append(this.Txt_Server.Text).Append(";");
sb.Append("Database=").Append(this.txt_db.Text).Append(";");
//sb.Append("Integrated Security=SSPI;");
sb.Append("uid=").Append(this.txt_uid.Text).Append(";");
sb.Append("pwd=").Append(this.txt_pwd.Text).Append(";");
sb.Append("Connect Timeout=30");
string connection_string = sb.ToString();
DataObject con = new DataObject(connection_string, false);
try
{
if (con.TestConnection())
this.lb_mess.Text = "Kết nối thành công";
else
this.lb_mess.Text = "Không thể kết nối!!!";
}
catch (Exception E)
{
this.lb_mess.Text = E.Message;
}
}
else
{
this.lb_mess.Text = "Mật khẩu cấu hình không đúng";
}
}
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:33,代码来源:DB_Access.ascx.cs
示例8: AddChildNodes
public DataObject AddChildNodes(DataObject parentObject, ObjectIdentitySet childIdentities)
{
List<ObjectIdentity> idList = childIdentities.Identities;
List<VdmChildrenActionInfo> caInfoList = new List<VdmChildrenActionInfo>();
foreach (ObjectIdentity objIdentity in idList)
{
VirtualDocumentNode vdmNode = new VirtualDocumentNode();
vdmNode.Identity = objIdentity;
VirtualDocumentInfo vdmInfo = new VirtualDocumentInfo();
vdmInfo.Binding = VirtualDocumentInfo.BINDING_LATE;
vdmInfo.CopyBehavior = CopyBehaviorMode.COPY;
vdmInfo.OverrideLateBinding = false;
vdmNode.Policy = vdmInfo;
VdmChildrenActionInfo caInfo = new VdmChildrenActionInfo();
caInfo.Action = VdmChildrenAction.APPEND;
caInfo.Node = vdmNode;
caInfoList.Add(caInfo);
}
VdmUpdateProfile vdmUpdateProfile = new VdmUpdateProfile();
List<String> versionLabels = new List<String>();
versionLabels.Add("testVersionLabel");
// make sure to add the CURRENT label if you
// want the virtual document to be CURRENT
versionLabels.Add("CURRENT");
vdmUpdateProfile.Labels = versionLabels;
OperationOptions options = new OperationOptions();
options.VdmUpdateProfile = vdmUpdateProfile;
return virtualDocumentService.Update(parentObject, caInfoList, options);
}
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:32,代码来源:VirtualDocumentServiceDemo.cs
示例9: Contains
public static DataObject Contains(DataObject geometry, DataObject other)
{
var g1 = (SqlGeometry) geometry.Value;
var g2 = (SqlGeometry) other.Value;
var result = Contains(g1, g2);
return DataObject.Boolean(result);
}
开发者ID:prepare,项目名称:deveeldb,代码行数:7,代码来源:SpatialSystemFunctions.cs
示例10: RegisterData
public static void RegisterData(DataObject.RegisterDataObject accountData)
{
MySqlConnection Connection = new MySqlConnection(ConnString);
try
{
Connection.Open();
MySqlCommand InsertCommand = new MySqlCommand("udsp_account_register", Connection);
InsertCommand.CommandType = CommandType.StoredProcedure;
Guid GuidId = Guid.NewGuid();
InsertCommand.Parameters.AddWithValue("var_Guid", GuidId.ToString());
InsertCommand.Parameters.AddWithValue("var_Username", accountData.UserName);
InsertCommand.Parameters.AddWithValue("var_Password", accountData.Password);
InsertCommand.Parameters.AddWithValue("var_FullName", accountData.FullName);
InsertCommand.Parameters.AddWithValue("var_EmailId", accountData.EmailId);
if (InsertCommand.ExecuteNonQuery() == 0)
throw new Exception("No person was registered");
}
catch (Exception ex)
{
throw ex;
}
finally
{
if(Connection.State== ConnectionState.Open)
{
Connection.Close();
}
}
}
开发者ID:Rathore25,项目名称:UserApplicationProject-asp.net-mvc4,代码行数:30,代码来源:Accounts.cs
示例11: ScriptManager
public ScriptManager(Application app)
{
_app = app;
_appObject = new AppObject(_app);
_dataObject = new DataObject(_app.Data);
}
开发者ID:nikhilk,项目名称:simplecloud,代码行数:7,代码来源:ScriptManager.cs
示例12: Distance
public static DataObject Distance(DataObject geometry, DataObject other)
{
var input = (SqlGeometry)geometry.Value;
var otherGeometry = (SqlGeometry) other.Value;
var result = Distance(input, otherGeometry);
return DataObject.Number(result);
}
开发者ID:prepare,项目名称:deveeldb,代码行数:7,代码来源:SpatialSystemFunctions.cs
示例13: Initialization
public void Initialization()
{
object1 = new DataObject { Id = 1 };
object1.Add("x", 2);
object1.Add("y", 2);
object2 = new DataObject { Id = 2 };
object2.Add("x", 5);
object2.Add("y", 2);
object3 = new DataObject { Id = 3 };
object3.Add("x", 4);
object3.Add("y", 3);
object4 = new DataObject { Id = 4 };
object4.Add("x", 3);
object4.Add("y", 6);
object5 = new DataObject { Id = 5 };
object5.Add("x", 8);
object5.Add("y", 8);
object6 = new DataObject { Id = 6 };
object6.Add("x", 9);
object6.Add("y", 7);
}
开发者ID:intervals-mining-lab,项目名称:libiada-core,代码行数:26,代码来源:DataTableTests.cs
示例14: GetValidationRules
public override IList<ValidationRule> GetValidationRules(DataObject current, string property)
{
IList<ValidationRule> rules = new List<ValidationRule>();
ValidationRule rule = new ValidationRule(GeneralAssertionTemplate.IsBusinessObjectNotNull(current, property));
rules.Add(rule);
return rules;
}
开发者ID:brendankowitz,项目名称:systembusinessobjects,代码行数:7,代码来源:ValidationAttributes.cs
示例15: InsertVerticalNode
public void InsertVerticalNode(DataObject up, DataObject down)
{
Up = up;
Down = down;
down.Up = this;
up.Down = this;
}
开发者ID:TheMunro,项目名称:sudoku,代码行数:8,代码来源:DataObject.cs
示例16: GetNodeTasks
public List<int> GetNodeTasks(int nodeId, DataObject.Constants.TaskState taskState)
{
List<Model.Command> commands = _CommandRepository.GetNodeCommands(nodeId, (int)taskState);
if (commands.Count <= 0)
return new List<int>();
else
return commands.Select(x => x.Id).ToList();
}
开发者ID:cnquan,项目名称:tasker,代码行数:8,代码来源:NodeServiceImpl.cs
示例17: IndexRange
/// <summary>
/// Constructs the range given a start and an end location
/// </summary>
/// <param name="startOffset">The offset of the first value of the range.</param>
/// <param name="firstValue">The first value of the range</param>
/// <param name="lastOffset">The offset within the range of the last value.</param>
/// <param name="endValue">The last value of the range.</param>
public IndexRange(RangeFieldOffset startOffset, DataObject firstValue, RangeFieldOffset lastOffset, DataObject endValue)
: this(false)
{
StartOffset = startOffset;
StartValue = firstValue;
EndOffset = lastOffset;
EndValue = endValue;
}
开发者ID:prepare,项目名称:deveeldb,代码行数:15,代码来源:IndexRange.cs
示例18: InsertHorizontalNode
public void InsertHorizontalNode(DataObject left, DataObject right)
{
Left = left;
Right = right;
right.Left = this;
left.Right = this;
}
开发者ID:TheMunro,项目名称:sudoku,代码行数:8,代码来源:DataObject.cs
示例19: ShowPermissions
public void ShowPermissions(DataObject dataObject)
{
List<Permission> permissions = dataObject.Permissions;
foreach (Permission permission in permissions)
{
Console.WriteLine(permission.Name);
}
}
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:8,代码来源:DataModelDemo.cs
示例20: InsertData
private void InsertData(string query, SqlParameter[] parameter)
{
DataObject dao = new DataObject();
if(dao.Insert(query, parameter) > 0)
{
MessageBox.Show("Usuario guardado con exito");
}
}
开发者ID:Huaypitufo,项目名称:Sistema-de-Nominas,代码行数:9,代码来源:Insert.cs
注:本文中的DataObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论