Пример #1
0
        public void GetConfigurationDetails_ReturnsExpectedValue_WhenItemIsDocumentable()
        {
            var details = DocumentationUtility.GetConfigurationDetails(new Documentable());

            Assert.NotEmpty(details);
            Assert.Equal("Test", details[0].Key);
        }
Пример #2
0
        public void GetConfigurationDetails_ReturnsExpectedValue_WhenItemIsNotDocumentable()
        {
            var details = DocumentationUtility.GetConfigurationDetails(new object());

            Assert.NotNull(details);
            Assert.Empty(details);
        }
Пример #3
0
        private void OnEnable()
        {
            InitialiseDocumentationOnRoot(this, rootVisualElement);
            StyleSheet exampleStyleSheet = DocumentationUtility.LoadAssetOfType <StyleSheet>("ExampleStyles", DocumentationUtility.SearchFilter.Packages);

            GetDefaultRoot().styleSheets.Add(exampleStyleSheet);
        }
Пример #4
0
 public virtual KeyValuePair <string, string>[] GetConfigurationDetails()
 {
     return(new[]
     {
         new KeyValuePair <string, string>("Serialization formatter", DocumentationUtility.GetFriendlyName(_formatter)),
         new KeyValuePair <string, string>("Physical root path", PhysicalRootPath),
         new KeyValuePair <string, string>("Total internal SFS trees", Trees.Count.ToString())
     });
 }
Пример #5
0
 private void RefreshAccess()
 {
     m_info.m_readMe        = ReadMeUtility.GetReadMeFile(m_selector);
     m_info.m_sample        = SampleUtility.GetSampleFolder(m_selector);
     m_info.m_documentation = DocumentationUtility.GetDocumentFolder(m_selector);
     m_info.m_changelog     = ChangeLogUtility.GetReadMeFile(m_selector);
     m_info.m_license       = LicenseUtility.GetReadMeFile(m_selector);
     QuickGit.GetGitInDirectory(m_selector.GetAbsolutePath(true), out m_info.m_gitLink, false);
 }
Пример #6
0
        public KeyValuePair <string, string>[] GetConfigurationDetails()
        {
            var configs = new List <KeyValuePair <string, string> >();

            foreach (var item in FieldFormatters)
            {
                configs.Add(new KeyValuePair <string, string>("Field formatter", DocumentationUtility.GetFriendlyName(item)));
            }

            return(configs.ToArray());
        }
Пример #7
0
 private void WriteName(ISymbol symbol, string text)
 {
     if (TypeSymbols != null &&
         symbol is INamedTypeSymbol typeSymbol &&
         TypeSymbols.Contains(typeSymbol))
     {
         _writer.WriteLink(
             text,
             "#" + DocumentationUtility.CreateLocalLink(symbol, LocalLinkPrefix),
             symbol.ToDisplayString(TypeSymbolDisplayFormats.Name_ContainingTypes_TypeParameters));
     }
Пример #8
0
 public virtual KeyValuePair <string, string>[] GetConfigurationDetails()
 {
     return(new[]
     {
         new KeyValuePair <string, string>("Serialization formatter", DocumentationUtility.GetFriendlyName(this._formatter)),
         new KeyValuePair <string, string>("Cloud root path", this.CloudRootPath),
         new KeyValuePair <string, string>("Azure BLOB container name", this._containerName),
         new KeyValuePair <string, string>("Total internal SFS trees", this.Trees.Count.ToString()),
         new KeyValuePair <string, string>("Use data cache", this._useDataCache.ToString()),
         new KeyValuePair <string, string>("Use blog list cache", this._useBlobListCache.ToString()),
         new KeyValuePair <string, string>("Use big files lazy load", this._useBigFilesLazyLoad.ToString()),
     });
 }
Пример #9
0
        public override void WriteTypeDefinition(INamedTypeSymbol typeSymbol, SymbolDisplayFormat format = null)
        {
            if (typeSymbol != null)
            {
                WriteDocumentationComment(typeSymbol);
                WriteDefinition(typeSymbol, format);
            }

            _writer.WriteRaw($"<a id=\"{DocumentationUtility.CreateLocalLink(typeSymbol, LocalLinkPrefix)}\"></a>");

            WriteLine();
            IncreaseDepth();

            WriteEndBulletItem();
        }
Пример #10
0
        private void RenderType(string categorization, string categoryDescription, object type, HtmlTextWriter writer)
        {
            var documentable = type as IDocumentable;

            writer.RenderBeginTag("li");
            writer.RenderBeginTag("h5");
            writer.Write(categorization);
            RenderHelp(categoryDescription, writer);
            writer.RenderEndTag();

            writer.RenderBeginTag("p");
            writer.RenderBeginTag("strong");
            writer.WriteEncodedText(DocumentationUtility.GetFriendlyName(type));
            writer.RenderEndTag();

            writer.Write(" <code>({0})</code>", type.GetType().FullName);
            writer.RenderEndTag();

            var description = DocumentationUtility.GetDescription(type);

            if (!string.IsNullOrWhiteSpace(description))
            {
                writer.Write("<p>{0}</p>", description);
            }

            var configuration = DocumentationUtility.GetConfigurationDetails(type);

            if (configuration == null || configuration.Length == 0)
            {
                writer.RenderEndTag();
                return;
            }

            writer.RenderBeginTag("ul");
            foreach (var config in configuration)
            {
                writer.RenderBeginTag("li");
                writer.RenderBeginTag("strong");
                writer.Write(config.Key);
                writer.RenderEndTag();

                writer.Write(": ");
                writer.Write(config.Value);
                writer.RenderEndTag();
            }
            writer.RenderEndTag();
            writer.RenderEndTag();
        }
Пример #11
0
        private void RenderType(bool collapsed, string categorization, string categoryDescription, object type, HtmlTextWriter writer)
        {
            writer.Write(@"
				<section>"                );

            writer.Write(@"
					<h{0}>{1}</h{0}>"                    , collapsed ? 3 : 4, categorization);

            writer.Write(@"
					<p class=""help"">{0}</p>"                    , categoryDescription);

            writer.Write(@"
					<h4>{0}</h4>"                    , DocumentationUtility.GetFriendlyName(type));

            var description = DocumentationUtility.GetDescription(type);

            if (!string.IsNullOrWhiteSpace(description))
            {
                writer.Write(@"
					<p>{0}</p>"                    , description);
            }

            var configuration = DocumentationUtility.GetConfigurationDetails(type);

            if (configuration != null && configuration.Length > 0)
            {
                writer.Write(@"
					<ul>"                    );

                foreach (var config in configuration)
                {
                    writer.Write(@"
						<li><strong>{0}</strong>: {1}</li>"                        , config.Key, config.Value);
                }

                writer.Write(@"
					</ul>"                    );
            }

            writer.Write(@"
				</section>"                );
        }
Пример #12
0
 private void ToggleAndCreateHiddenFolder()
 {
     GUILayout.BeginHorizontal();
     GUILayout.Label("Create:", EditorStyles.boldLabel);
     if (GUILayout.Button("Documentation"))
     {
         DocumentationUtility.Create(m_selector, false); Refresh();
     }
     if (GUILayout.Button("Samples"))
     {
         SampleUtility.Create(m_selector, false);
         Refresh();
     }
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal();
     GUILayout.Label("Toogle:", EditorStyles.boldLabel);
     if (GUILayout.Button("Documentation"))
     {
         DocumentationUtility.Toggle(m_selector); Refresh();
     }
     if (GUILayout.Button("Samples"))
     {
         SampleUtility.Toggle(m_selector); Refresh();
     }
     GUILayout.EndHorizontal(); GUILayout.BeginHorizontal();
     GUILayout.Label("Delete:", EditorStyles.boldLabel);
     if (GUILayout.Button("Documentation"))
     {
         m_info.m_documentation.Delete(); Refresh();
     }
     if (GUILayout.Button("Samples"))
     {
         m_info.m_sample.Delete(); Refresh();
     }
     GUILayout.EndHorizontal();
 }
Пример #13
0
 public virtual KeyValuePair <string, string>[] GetConfigurationDetails()
 {
     return(new [] { new KeyValuePair <string, string>("Deserializer", DocumentationUtility.GetFriendlyName(_deserializer)) });
 }
Пример #14
0
 public void GetFriendlyName_ReturnsExpectedValue_WhenItemIsDocumentable()
 {
     Assert.Equal("Test", DocumentationUtility.GetFriendlyName(new Documentable()));
 }
Пример #15
0
 public KeyValuePair <string, string>[] GetConfigurationDetails()
 {
     return(DocumentationUtility.GetConfigurationDetails(_innerDataStore.Value));
 }
Пример #16
0
 public void GetFriendlyName_ReturnsExpectedValue_WhenItemIsNotDocumentable()
 {
     Assert.Equal(typeof(object).Name, DocumentationUtility.GetFriendlyName(new object()));
 }
Пример #17
0
 public void GetDescription_ReturnsExpectedValue_WhenItemIsDocumentable()
 {
     Assert.Equal("Description", DocumentationUtility.GetDescription(new Documentable()));
 }
Пример #18
0
 public override KeyValuePair <string, string>[] GetConfigurationDetails()
 {
     return(new[] { new KeyValuePair <string, string>("Item comparer", DocumentationUtility.GetFriendlyName(_itemComparer)) });
 }
Пример #19
0
 public void GetDescription_ReturnsExpectedValue_WhenItemIsNotDocumentable()
 {
     Assert.Equal(typeof(object).AssemblyQualifiedName, DocumentationUtility.GetDescription(new object()));
 }
 private void WriteLocalLink(ISymbol symbol)
 {
     WriteString(DocumentationUtility.CreateLocalLink(symbol));
 }
    public static void DrawPackageEditor(UnityPathSelectionInfo selection, PackageJsonFileStream packageTarget, PackageBuildInformation package)
    {
        string        path      = packageTarget.GetAbsolutePath();
        GitLinkOnDisk gitLinked = packageTarget.GetLinkedGit();

        GUILayout.BeginHorizontal();

        if (GUILayout.Button("Create package.json"))
        {
            LoadSamplesFromDirectoryToPackage(selection, ref package);
            string json = PackageBuilder.GetPackageAsJson(package);
            packageTarget.Set(json, true);
            AssetDatabase.Refresh();
        }
        if (GUILayout.Button("Create Files & Folders"))
        {
            PackageBuilder.CreateUnityPackage(packageTarget.GetPackageProjectRoot(), package);
            AssetDatabase.Refresh();
        }


        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();

        if (string.IsNullOrEmpty(package.m_projectName))
        {
            package.m_projectName = UnityPaths.AlphaNumeric(Application.productName);
        }

        package.m_projectName = (GUILayout.TextField("" + package.m_projectName));
        GUILayout.EndHorizontal();


        GUILayout.BeginHorizontal();


        if (string.IsNullOrEmpty(package.m_projectAlphNumId))
        {
            // package.m_projectAlphNumId = UnityPaths.AlphaNumeric(Application.productName, true);
            package.m_projectAlphNumId = selection.GetSelectName(true);
        }
        if (string.IsNullOrEmpty(package.m_company))
        {
            package.m_company = UnityPaths.AlphaNumeric(Application.companyName);
        }

        package.m_country = UnityPaths.AlphaNumeric(GUILayout.TextField("" + package.m_country));
        GUILayout.Label(".", GUILayout.Width(5));
        package.m_company = UnityPaths.AlphaNumeric(GUILayout.TextField("" + package.m_company));
        GUILayout.Label(".", GUILayout.Width(5));
        package.m_projectAlphNumId = UnityPaths.AlphaNumeric(GUILayout.TextField("" + package.m_projectAlphNumId));
        GUILayout.EndHorizontal();
        GUILayout.Label("Namespace ID: " + package.GetProjectNamespaceId());

        GUILayout.Label("Description");
        package.m_description = GUILayout.TextArea(package.m_description, GUILayout.MinHeight(100));
        GUILayout.BeginHorizontal();
        GUILayout.Label("Tags:", GUILayout.MaxWidth(60));
        package.m_keywords = GUILayout.TextField(string.Join(",", package.m_keywords)).Split(',');
        GUILayout.EndHorizontal();

        GUILayout.Label("Author");
        GUILayout.BeginHorizontal();

        GUILayout.Label("Name: ", GUILayout.MaxWidth(60));
        package.m_author.m_name = GUILayout.TextField(package.m_author.m_name);
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Mail: ", GUILayout.MaxWidth(60));
        package.m_author.m_mail = GUILayout.TextField(package.m_author.m_mail);
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Url: ", GUILayout.MaxWidth(60));
        package.m_author.m_url = GUILayout.TextField(package.m_author.m_url);
        GUILayout.EndHorizontal();


        GUILayout.Label("Repository Info");
        GUILayout.BeginHorizontal();
        GUILayout.Label("Git Url: ", GUILayout.MaxWidth(60));


        package.m_repositoryLink.m_url = GUILayout.TextField(gitLinked.GetUrl());
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        GUILayout.Label("Revision: ", GUILayout.MaxWidth(60));
        package.m_repositoryLink.m_revision = GUILayout.TextField(gitLinked.GetLastRevision());

        GUILayout.EndHorizontal();


        GUILayout.Space(10);
        GUILayout.Label("Direct dependence");
        DrawEditableDependency(ref package.m_otherPackageDependency);
        GUILayout.Space(10);
        GUILayout.Label("Relative dependence");
        DrawEditableDependency(ref package.m_otherPackageRelation);


        SampleDirectoryStream sample = SampleUtility.GetSampleFolder(selection);

        SampleEditor.DrawInfoAboutInterface(sample);

        DocumentationDirectoryStream documentation = DocumentationUtility.GetDocumentFolder(selection);

        DocumentationEditor.DrawInfoAboutInterface(documentation);
    }