当前位置: 首页>>代码示例>>C#>>正文


C# IElement.ToString方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:gilind,项目名称:workshop,代码行数:25,代码来源:StringConverter.cs

示例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;
     }
 }
开发者ID:StephOfPixVert,项目名称:ShootingLab,代码行数:19,代码来源:frmPdVMain.cs

示例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; }
     }
 }
开发者ID:StephOfPixVert,项目名称:ShootingLab,代码行数:12,代码来源:frmPdVMain.cs

示例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;
        }
开发者ID:GorillaOne,项目名称:FlatRedBall,代码行数:32,代码来源:ErrorManager.cs

示例5: RtfHeaderFooter

 /**
 * Constructs a new header
 * @param content
 */
 public RtfHeaderFooter( IElement content )
     : base(new Phrase(content.ToString()), false)
 {
     this.content = content;
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:9,代码来源:RtfHeaderFooter.cs

示例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();
            }
        }
开发者ID:GorillaOne,项目名称:FlatRedBall,代码行数:56,代码来源:ElementViewWindow.cs


注:本文中的IElement.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。