本文整理汇总了C#中IElement.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IElement.ToString方法的具体用法?C# IElement.ToString怎么用?C# IElement.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IElement
的用法示例。
在下文中一共展示了IElement.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddElementToStringCollection
private static void AddElementToStringCollection(IElement element, ref StringCollection stringCollection,
int currentLevel, string prefix, bool isLast)
{
if (currentLevel == 0)
stringCollection.Add(element.ToString());
else
{
stringCollection.Add(prefix + "|_" + element);
if (isLast && element.ChildrenCount == 0)
stringCollection.Add(prefix);
if (isLast)
prefix += " ";
else
prefix += "| ";
}
for (int childIndex = 0; childIndex < element.ChildrenCount; childIndex++)
{
IElement child = element[childIndex];
AddElementToStringCollection(child, ref stringCollection, currentLevel + 1, prefix,
childIndex == element.ChildrenCount - 1);
}
}
示例2: RenamePhoto
/// <summary>
/// Renommer les photos d'un élement
/// </summary>
/// <param name="_selectedItem"></param>
private void RenamePhoto(IElement _selectedItem)
{
string _rawDirectory = p_applClass.RootDir + "\\" + p_applClass.Param.ExportDirectory + "\\" + _selectedItem.Class;
for (int _indicePhoto = 0; _indicePhoto < _selectedItem.Photos.Count; _indicePhoto++)
{
FilePhoto _photo = _selectedItem.Photos[_indicePhoto];
string _srcDirectory = _rawDirectory + "\\" + _photo.TypeDirectory ;
string _newName = _selectedItem.ToString() + "_" + _photo.NumPhoto.ToString() + ClassOutils.getExtension(_photo.FileName);
string _newPath = ClassOutils.MoveFile(_srcDirectory + "\\" + _photo.FileName, _srcDirectory, _newName);
// Il faut aussi renommer la vignette
string _thumbFile = PhotoTools.GetThumbFileName(_srcDirectory + "\\" + _photo.FileName);
string _newThumb = ClassOutils.MoveFile(_thumbFile, PhotoTools.GetThumbDir(_srcDirectory + "\\" + _photo.FileName), _newName);
_photo.FileName = _newName;
}
}
示例3: lstPupils_SelectedIndexChanged
private void lstPupils_SelectedIndexChanged(object sender, EventArgs e)
{
if (lstPupils.SelectedIndices.Count == 0) { return; }
else
{
p_numItemSelected = lstPupils.SelectedIndices[0];
p_activeElement = p_SessionBase.Content.ListElement[p_numItemSelected];
lblNameItemSel.Text = p_activeElement.ToString();
if (p_activeElement.Passed) { lblNameItemSel.ForeColor = Color.Red; }
else { lblNameItemSel.ForeColor = Color.Green; }
}
}
示例4: CheckForMissingTunnelReferences
private static bool CheckForMissingTunnelReferences(IElement asIElement)
{
bool errorFound = false;
foreach (CustomVariable variable in asIElement.CustomVariables)
{
if (!string.IsNullOrEmpty(variable.SourceObject))
{
NamedObjectSave nos = asIElement.GetNamedObjectRecursively(variable.SourceObject);
if (nos == null)
{
errorFound = true;
MessageBox.Show("The variable " + variable.Name + " references " + variable.SourceObject + " but " +
"this object doesn't exist.");
}
else
{
List<string> availableMembers = ExposedVariableManager.GetExposableMembersFor(nos).Select(item => item.Member).ToList();
if (!availableMembers.Contains(variable.SourceObjectProperty))
{
errorFound = true;
MessageBox.Show("The variable " + variable.Name + " references the property " + variable.SourceObjectProperty +
"in " + asIElement.ToString() + " which does not exist.");
}
}
}
}
return errorFound;
}
示例5: RtfHeaderFooter
/**
* Constructs a new header
* @param content
*/
public RtfHeaderFooter( IElement content )
: base(new Phrase(content.ToString()), false)
{
this.content = content;
}
示例6: AskAndAddAllContainedRfsToGlobalContent
private static void AskAndAddAllContainedRfsToGlobalContent(IElement element)
{
string message = "Add all contained files in " + element.ToString() + " to Global Content Files? Files will still be referenced by " + element.ToString();
DialogResult dialogResult = MessageBox.Show(message, "Add to Global Content?", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
if (!element.UseGlobalContent)
{
string screenOrEntity = "Screen";
if (element is EntitySave)
{
screenOrEntity = "Entity";
}
DialogResult result = MessageBox.Show("The " + screenOrEntity + " " + element.ToString() +
"does not UseGlobalContent. Would you like " +
" to set UseGlobalContent to true?", "Set UseGlobalContent to true?", MessageBoxButtons.YesNo);
if (result == DialogResult.Yes)
{
element.UseGlobalContent = true;
}
}
foreach (ReferencedFileSave rfs in element.ReferencedFiles)
{
bool alreadyExists = false;
foreach (ReferencedFileSave existingRfs in ObjectFinder.Self.GlueProject.GlobalFiles)
{
if (existingRfs.Name.ToLower() == rfs.Name.ToLower())
{
alreadyExists = true;
break;
}
}
if (!alreadyExists)
{
bool useFullPathAsName = true;
ElementCommands.Self.AddReferencedFileToGlobalContent(rfs.Name, useFullPathAsName);
}
}
ContentLoadWriter.UpdateLoadGlobalContentCode();
ProjectManager.SaveProjects();
GluxCommands.Self.SaveGlux();
}
}