本文整理汇总了C#中Domain.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Domain.ToString方法的具体用法?C# Domain.ToString怎么用?C# Domain.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFullFilePathByFileID
public string GetFullFilePathByFileID(long FileID, Domain.File.Sizes FileSize)
{
string result = "";
File file = _fileRepository.GetFileByID(FileID);
if (file != null)
{
Folder folder = _folderRepository.GetFolderByID(file.DefaultFolderID);
result = folder.CreateDate.Year.ToString() + folder.CreateDate.Month.ToString() + "/" +
file.FileSystemName + "__" + FileSize.ToString() + "." + file.Extension;
}
return result;
}
示例2: CompareTo
public int CompareTo(Domain other)
{
return ToString().CompareTo(other.ToString());
}
示例3: AuthenticateUser
private void AuthenticateUser(Domain.User user, UserLogin userLogin)
{
SessionContext.CurrentUser = user;
FormsAuthentication.SetAuthCookie(userLogin.UserName, false);
var ticket = new FormsAuthenticationTicket(1, userLogin.UserName, DateTime.UtcNow, DateTime.UtcNow.AddMinutes(System.Web.HttpContext.Current.Session.Timeout),
false, user.ToString(), FormsAuthentication.FormsCookiePath);
var encryptedTicket = FormsAuthentication.Encrypt(ticket);
var authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket) { HttpOnly = true };
authCookie.Expires = ticket.Expiration;
System.Web.HttpContext.Current.Response.Cookies.Add(authCookie);
_sessionContext.SetUpSessionContext(HttpContext, SessionContext.CurrentUser);
SetUserIdentity(SessionContext.LoggedOnUser);
}
示例4: SetVersion
public override bool SetVersion(string databaseName, Domain.Values.Version version)
{
fileWriter.WriteLine(String.Format(CultureInfo.InvariantCulture, "--"));
fileWriter.WriteLine(String.Format(CultureInfo.InvariantCulture, "-- Set database version - {0}", version.ToString()));
fileWriter.WriteLine(String.Format(CultureInfo.InvariantCulture, "--"));
return true;
}
示例5: Matches
private static bool Matches(Domain domain, Domain entry)
{
string[] labels = entry.ToString().Split('.');
string[] patterns = new string[labels.Length];
for (int i = 0; i < labels.Length; i++) {
string label = labels[i];
patterns[i] = label == "*" ? "(\\w+)" : Regex.Escape(label);
}
Regex re = new Regex("^" + string.Join("\\.", patterns) + "$");
return re.IsMatch(domain.ToString());
}
示例6: Test
//.........这里部分代码省略.........
procs
Insert
, Update
, SelectMany
, Select (Id)
, Select (Code)
, Select (Name)
, DeleteMany
, Activate
, Deactivate
, GetIds
tasks
Add
, Edit
, Delete
, Activate
, Deactivate
, MoveUp
, MoveDown
entity WorkoutType
Id short auto
, ProgrammeId Programme
, Code string(4, 10) unique
, Name string(4, 50) unique
, Multiple bool
, SortOrder short
indexes
unique (ProgrammeId Code)
, unique (ProgrammeId Name)
procs
SelectMany
, SelectMany (ProgrammeId)
, Insert
, Update
, DeleteMany
entity WorkoutDate
Id int auto
, ProgrammeId Programme
, TrainerId Account null
, AccountId Account null
, Date date
, Duration short
, Detail string(2000)
procs
Select (Id)
, Select (ProgrammeId Date)
, Insert
, Update
, DeleteMany
, GetIds
tasks
Add
, Delete
, EditResult 'Edit Result' one
, Copy 'Copy' one
entity Workout
Id int auto
, WorkoutDateId WorkoutDate
, WorkoutTypeId WorkoutType
, Detail string(1000)
indexes
unique (WorkoutDateId WorkoutTypeId)
entity Result
Id int auto
, WorkoutDateId WorkoutDate
, AccountId Account
, Detail string(1000)
indexes
unique (WorkoutDateId AccountId)
procs
Insert
, Update
, DeleteMany
, Select (Id)
, Select (WorkoutDateId AccountId)
entity AccountProgramme
Id int auto
, AccountId Account
, ProgrammeId Programme
procs
Insert
, DeleteMany
, SelectMany (AccountId)
, SelectMany (ProgrammeId)";
var node = parser.Parse(domainDef);
var nodeString = NodeToString(node);
var domain = new Domain(node);
var actual = domain.ToString();
Assert.That(actual, Is.EqualTo(domainDef));
}