本文整理汇总了C#中System.Guid.str方法的典型用法代码示例。如果您正苦于以下问题:C# Guid.str方法的具体用法?C# Guid.str怎么用?C# Guid.str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Guid
的用法示例。
在下文中一共展示了Guid.str方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: xmlDB_NewGuidanceItem
public static guidanceItem xmlDB_NewGuidanceItem(this TM_Xml_Database tmDatabase, Guid guidanceItemId,
string title, string images,
// DateTime lastUpdate,
string topic, string technology, string category,
string ruleType, string priority, string status,
string author,string phase, string htmlContent,
Guid libraryId
)
{
var guidanceItem = new guidanceItem()
{
id = (guidanceItemId == Guid.Empty)
? Guid.NewGuid().str()
: guidanceItemId.str(),
Author = author,
Category = category,
content = htmlContent,
// Date = lastUpdate.str(),
Priority = priority,
Rule_Type = ruleType,
//.Source ;
Status = status,
Technology = technology,
title = title,
Topic = topic,
phase = phase,
libraryId = libraryId.str()
// .Type1;
// .type;
};
guidanceItem.xmlDB_Save_GuidanceItem(libraryId, tmDatabase);
return guidanceItem;
}
示例2: xmlDB_NewGuidanceExplorer
public static guidanceExplorer xmlDB_NewGuidanceExplorer(this TM_Xml_Database tmDatabase, Guid libraryId, string caption)
{
"[TM_Xml_Database][xmlDB_NewGuidanceExplorer] Creating new Library with id {0} and caption {1}".info(libraryId, caption);
if (caption.isValidGuidanceExplorerName().isFalse())
{
"[TM_Xml_Database][xmlDB_NewGuidanceExplorer] provided caption didn't pass validation regex".error();
throw new Exception("Provided Library name didn't pass validation regex");
}
if (tmDatabase.tmLibrary(caption).notNull())
{
"[TM_Xml_Database] in xmlDB_NewGuidanceExplorer, a library with that name already existed: {0}".error(caption);
return null;
}
if (libraryId == Guid.Empty)
libraryId = Guid.NewGuid();
var newGuidanceExplorer = new urn.microsoft.guidanceexplorer.guidanceExplorer();
newGuidanceExplorer.library = new urn.microsoft.guidanceexplorer.Library();
newGuidanceExplorer.library.items = new urn.microsoft.guidanceexplorer.Items();
newGuidanceExplorer.library.libraryStructure = new urn.microsoft.guidanceexplorer.LibraryStructure();
//newGuidanceExplorer.library.libraryStructure.folder = new List<urn.microsoft.guidanceexplorer.Folder>();
//newGuidanceExplorer.library.libraryStructure.view = new List<urn.microsoft.guidanceexplorer.View>();
newGuidanceExplorer.library.name = libraryId.str();
newGuidanceExplorer.library.caption = caption;
"xmlLibraryPath: {0}".info(TM_Xml_Database.Path_XmlLibraries);
//var newLibraryPath = TM_Xml_Database.Path_XmlLibraries.pathCombine("{0}.xml".format(caption));
newGuidanceExplorer.xmlDB_Save_GuidanceExplorer(tmDatabase);
//"saving new library to: {0}".info(newLibraryPath);
//newGuidanceExplorer.Save(newLibraryPath);
//tmDatabase.setGuidanceExplorerObjects(); // reload these values
return newGuidanceExplorer;
}
开发者ID:TeamMentor,项目名称:TM_3.2_with_OWASP_Library,代码行数:34,代码来源:TM_Xml_Database.Library.GuidanceExplorer.cs
示例3: fixGuidanceItemFileDueToGuidConflict
public static TeamMentor_Article fixGuidanceItemFileDueToGuidConflict(this TM_Xml_Database tmDatabase, Guid original_Guid, string fullPath)
{
var newGuid = Guid.NewGuid();
var newPath = fullPath.replace(original_Guid.str(), newGuid.str());
Files.moveFile(fullPath, newPath);
"[xmlDB_GuidanceItem] resolved GuidanceItem ID conflict for Id '{0}' was already mapped. \nExisting path: \t{1} \nNew path: \t{2}".error(original_Guid, fullPath , newPath);
var guidanceItemV3 = tmDatabase.xmlDB_GuidanceItem(newGuid, newPath);
return guidanceItemV3;
}
开发者ID:TeamMentor,项目名称:Dev,代码行数:9,代码来源:TM_Xml_Database_ExtensionMethods_XmlDataSources_GuidanceItems_Load.cs
示例4: newGuidanceItemObject
public static GuidanceItem newGuidanceItemObject(Guid id, string title, Guid guidanceType, Guid library, Guid creator, string creatorCaption, string content, string images, DateTime lastUpdate)
{
var guidanceItem = new GuidanceItem { id =id.str(),
title = title,
guidanceType = guidanceType.str(),
library = library.str(),
creator = creator.str(),
creatorCaption = creatorCaption,
content = content,
images = images,
lastUpdate = lastUpdate
};
return guidanceItem;
}
示例5: RenameLibrary
public bool RenameLibrary(Guid libraryId, string newName)
{
this.resetCache();
if (javascriptProxy.GetLibraryById(libraryId.str()).isNull())
return false;
var libraryToRename = new Library { id = libraryId.str(), caption = newName };
return javascriptProxy.UpdateLibrary(libraryToRename);
}
示例6: SetArticleContent
public bool SetArticleContent(Guid articleId, string dataType, string content)
{
resetCache();
var article = javascriptProxy.GetGuidanceItemById(articleId.str());
if (article.notNull())
{
article.Content.Data.Value = content;
article.Content.DataType = dataType;
return javascriptProxy.UpdateGuidanceItem(article);
}
return false;
}
示例7: DeleteLibrary
public bool DeleteLibrary(Guid libraryId)
{
this.resetCache();
if (javascriptProxy.GetLibraryById(libraryId.str()).isNull())
return false;
var libraryToDelete = new Library { id = libraryId.str(), delete = true };
javascriptProxy.UpdateLibrary(libraryToDelete);
var libraryDeleted = javascriptProxy.GetLibraryById(libraryId.str());
return libraryDeleted.isNull();// || libraryDeleted.delete;
}
示例8: GetLibraryById
public Library GetLibraryById(Guid libraryId)
{
return javascriptProxy.GetLibraryById (libraryId.str());
}
示例9: xmlDB_GuidanceItem
//[PrincipalPermission(SecurityAction.Demand, Role = "EditArticles")]
public static GuidanceItem_V3 xmlDB_GuidanceItem(this TM_Xml_Database tmDatabase, Guid guidanceItemId, string fullPath)
{
try
{
if (TM_Xml_Database.Cached_GuidanceItems.hasKey(guidanceItemId))
{
//"found match for id: {0} in {1}".info(guidanceItemId, fullPath);
if (TM_Xml_Database.GuidanceItems_FileMappings[guidanceItemId] != fullPath)
{
//"[xmlDB_GuidanceItem] GuidanceItem ID conflict, the Id '{0}' was already mapped. \nExisting path: \t{1} \nNew path: \t{2}".error(
// guidanceItemId, TM_Xml_Database.GuidanceItems_FileMappings[guidanceItemId] , fullPath);
return tmDatabase.fixGuidanceItemFileDueToGuidConflict(guidanceItemId, fullPath);
}
return TM_Xml_Database.Cached_GuidanceItems[guidanceItemId];
}
if(fullPath.notNull())
{
//"trying to load id {0} from virtualPath: {1}".info(guidanceItemId, virtualPath);
var pathXmlLibraries = TM_Xml_Database.Path_XmlLibraries;
/*var fullPath = virtualPath.fileExists()
? virtualPath
: pathXmlLibraries.pathCombine(virtualPath).fullPath();*/
if (fullPath.fileExists())
{
//"loading {0}".info(fullPath);
var _guidanceItem = guidanceItem.Load(fullPath);
if (_guidanceItem.notNull())
{
if(_guidanceItem.id.guid() != guidanceItemId)
{
"FOUND GUID CHANGE".error();
_guidanceItem.id_original = _guidanceItem.id;
_guidanceItem.id = guidanceItemId.str();
_guidanceItem.Save(fullPath);
}
//guidanceItemV3.guidanceItemId = original_Guid; // this gives us the ability to track its source
//guidanceItemV3.source_guidanceItemId = newGuid; // also provides support for moving GuidanceItems across libraries
var _guidanceItemV3 = _guidanceItem.tmGuidanceItemV3();
TM_Xml_Database.Cached_GuidanceItems.Add(guidanceItemId, _guidanceItemV3);
TM_Xml_Database.GuidanceItems_FileMappings.add(guidanceItemId, fullPath);
return _guidanceItemV3;
}
}
else
"[xmlDB_GuidanceItem] could not find file: {0}".error(fullPath);
}
else
"no virtualPath provided for id: {0}".error(guidanceItemId);
}
catch(Exception ex)
{
"[TM_Xml_Database] in xmlDB_GuidanceItem: {0}".error(ex.Message);
}
return null;
}
示例10: UpdateGuidanceItemHtml
public bool UpdateGuidanceItemHtml(Guid guidanceItemId, string htmlContent)
{
var guidanceItem = javascriptProxy.GetGuidanceItemById(guidanceItemId.str());
new PagesHistory().logPageChange(guidanceItemId, currentUser.UserName, sessionID, guidanceItem.htmlContent.sanitizeHtmlContent());
guidanceItem.htmlContent = htmlContent.sanitizeHtmlContent();
return javascriptProxy.UpdateGuidanceItem(guidanceItem);
}
示例11: xmlDB_Folder
public static urn.microsoft.guidanceexplorer.Folder xmlDB_Folder(this TM_Xml_Database tmDatabase, Guid libraryId, Guid folderId)
{
foreach(var folder in tmDatabase.xmlDB_Folders_All(libraryId))
if(folder.folderId == folderId.str())
return folder;
return null;
}
示例12: IsGuidMappedInThisServer
public bool IsGuidMappedInThisServer(Guid guid)
{
if (GetGuidanceItemById(guid.str()).notNull())
return true;
if (TM_Xml_Database.Current.get_GuidRedirect(guid).valid())
return true;
return false;
}
示例13: GetLibraryById
[WebMethod(EnableSession = true)] public Library GetLibraryById (Guid libraryId) { return javascriptProxy.GetLibraryById (libraryId.str()); }
示例14: hash_PBKDF2
public static string hash_PBKDF2(this string password, Guid salt)
{
return password.hash_PBKDF2(salt.str());
}
示例15: xmlDB_Folder
public static urn.microsoft.guidanceexplorer.Folder xmlDB_Folder(this TM_Xml_Database tmDatabase, Guid libraryId, Guid folderId)
{
return tmDatabase.xmlDB_Folders_All(libraryId)
.FirstOrDefault(folder => folder.folderId == folderId.str());
}