/// <summary>
        /// Populate <see cref="HierarchyType"/> from <paramref name="buildFrom"/>.
        /// </summary>
        /// <param name="hierarchyType">
        /// The hierarchy type.
        /// </param>
        /// <param name="buildFrom">
        /// The build from.
        /// </param>
        public void BuildList(HierarchyType hierarchyType, ILevelObject buildFrom)
        {
            int order = 1;
            do
            {
                var builtObj = new LevelType();
                hierarchyType.Level.Add(builtObj);

                string value = buildFrom.Id;
                if (!string.IsNullOrWhiteSpace(value))
                {
                    builtObj.id = buildFrom.Id;
                }

                if (ObjectUtil.ValidString(buildFrom.Urn))
                {
                    builtObj.urn = buildFrom.Urn;
                }

                IList<ITextTypeWrapper> names = buildFrom.Names;
                if (ObjectUtil.ValidCollection(names))
                {
                    builtObj.Name = this.GetTextType(names);
                }

                IList<ITextTypeWrapper> descriptions = buildFrom.Descriptions;
                if (ObjectUtil.ValidCollection(descriptions))
                {
                    builtObj.Description = this.GetTextType(descriptions);
                }

                if (this.HasAnnotations(buildFrom))
                {
                    builtObj.Annotations = this.GetAnnotationsType(buildFrom);
                }

                builtObj.Order = order;
                if (buildFrom.CodingFormat != null)
                {
                    var textFormatType = new TextFormatType();
                    this.PopulateTextFormatType(textFormatType, buildFrom.CodingFormat);
                    builtObj.CodingType = textFormatType;
                }

                buildFrom = buildFrom.ChildLevel;
                order++;
            }
            while (buildFrom != null);
        }
 public HierarchyProperty(HierarchyType hierarchyType, string rootPath, bool forceImport)
 {
     m_Ptr = Internal_Create(hierarchyType, rootPath, forceImport);
 }
    #pragma warning restore 169

        public HierarchyProperty(HierarchyType hierarchyType)
            : this(hierarchyType, "Assets", true)
        {
        }
示例#4
0
 public FilteredHierarchy(HierarchyType type)
 {
     m_HierarchyType = type;
 }
 extern public HierarchyProperty(HierarchyType hierarchyType, string rootPath, bool forceImport);
示例#6
0
 public Callback(ref Application onenoteApplication, HierarchyType hierarchyType)
 {
     _onenoteApp    = onenoteApplication;
     _hierarchyType = hierarchyType;
 }
 public HierarchyAttribute(HierarchyType itemType, string referencePath)
 {
     ItemType       = itemType;
     ReferencePath  = referencePath;
     CreateInstance = true;
 }
 private void RefreshHierarchy(HierarchyType hierarchyType, SearchFilter searchFilter, bool foldersFirst)
 {
   this.m_FilteredHierarchy = new FilteredHierarchy(hierarchyType);
   this.m_FilteredHierarchy.foldersFirst = foldersFirst;
   this.m_FilteredHierarchy.searchFilter = searchFilter;
   this.m_FilteredHierarchy.RefreshVisibleItems(this.m_Owner.m_State.m_ExpandedInstanceIDs);
 }
示例#9
0
 public Hierarchy(string name, string code, long spId, long?parentId, long customerId, HierarchyType hierarchyType)
     : this(name, code, spId, hierarchyType)
 {
     this.ParentId   = parentId;
     this.CustomerId = customerId;
 }
示例#10
0
        public static object ObjectListArea(string searchFilter, string requiredType, HierarchyType hierarchy)
        {
            var assembly           = typeof(EditorWindow).Assembly;
            var objectListAreaType = assembly.GetType("UnityEditor.ObjectListArea");

            var objectListArea = Activator.CreateInstance(objectListAreaType, new object[] { null, null, true });

            var init = objectListAreaType.GetMethod("Init", BindingFlags.Public | BindingFlags.Instance);

            init.Invoke(objectListArea, new object[] { searchFilter, requiredType, null, hierarchy });

            return(objectListArea);
        }
示例#11
0
 public static List <AssetResult> GetAssetsInProjectOfType <T>(HierarchyType assets = HierarchyType.Assets)
     where T : Object
 {
     return(GetAssetsInProjectOfType(typeof(T), assets));
 }
示例#12
0
        public static List <AssetResult> GetAssetsInProjectOfType(Type type, HierarchyType assets = HierarchyType.Assets)
        {
            try
            {
                var assembly = typeof(EditorWindow).Assembly;
                var filteredHierarchyType = assembly.GetType("UnityEditor.FilteredHierarchy");

                var filteredHierarchy = Activator.CreateInstance(filteredHierarchyType, new object[] { assets });

#if UNITY_3_4 || UNITY_3_5
                var objectListAreaType = assembly.GetType("UnityEditor.ObjectListArea");

                var filterProperty = filteredHierarchyType.GetProperty("filter",
                                                                       BindingFlags.Public | BindingFlags.Instance);
                var searchModeProperty = filteredHierarchyType.GetProperty("searchMode",
                                                                           BindingFlags.Public | BindingFlags.Instance);

                var createFilterString = objectListAreaType.GetMethod("CreateFilterString",
                                                                      BindingFlags.NonPublic | BindingFlags.Static);

                var filterString = createFilterString.Invoke(null, new object[] { "", type.Name, null });

                filterProperty.SetValue(filteredHierarchy, filterString, null);
                searchModeProperty.SetValue(filteredHierarchy, 0, null);
#else
                var searchFilterType = assembly.GetType("UnityEditor.SearchFilter");
                var classNames       = searchFilterType.GetProperty("classNames", BindingFlags.Instance | BindingFlags.Public);

                var searchFilterProperty = filteredHierarchyType.GetProperty("searchFilter", BindingFlags.Public | BindingFlags.Instance);

                var sfilter = Activator.CreateInstance(searchFilterType);

                classNames.SetValue(sfilter, new[] { type.ToString() }, null);

                searchFilterProperty.SetValue(filteredHierarchy, sfilter, null);
#endif

                var resultField = filteredHierarchyType.GetField("m_Results",
                                                                 BindingFlags.NonPublic | BindingFlags.Instance);

                var results = (Array)resultField.GetValue(filteredHierarchy);

                var list = new List <AssetResult>();

                foreach (var r in results)
                {
                    var assetResult = ObjToFilterResult(r);
                    list.Add(assetResult);
                }

                return(list);
            }
            catch (Exception)
            {
                if (!_errorMajor)
                {
                    Debug.LogError(
                        "For some reason it appears something went wrong with Tilers Asset Search. Tiler is unable to operate properly." +
                        "\nYour version is: " + Application.unityVersion +
                        " Please report this on the forums and I'll try fix it asap.");
                    _errorMajor = true;
                }

                return(new List <AssetResult>());
            }
        }
示例#13
0
		public void Init(Rect rect, HierarchyType hierarchyType, SearchFilter searchFilter, bool checkThumbnails)
		{
			this.m_VisibleRect = rect;
			this.m_TotalRect = rect;
			this.m_LocalAssets.UpdateFilter(hierarchyType, searchFilter, this.foldersFirst);
			foreach (ObjectListArea.AssetStoreGroup current in this.m_StoreAssets)
			{
				current.UpdateFilter(hierarchyType, searchFilter, this.foldersFirst);
			}
			bool flag = searchFilter.GetState() == SearchFilter.State.FolderBrowsing;
			if (flag)
			{
				this.m_LastAssetStoreQuerySearchFilter = string.Empty;
				this.m_LastAssetStoreQueryClassName = new string[0];
				this.m_LastAssetStoreQueryLabels = new string[0];
			}
			else
			{
				this.m_LastAssetStoreQuerySearchFilter = ((searchFilter.nameFilter != null) ? searchFilter.nameFilter : string.Empty);
				bool flag2 = searchFilter.classNames == null || Array.IndexOf<string>(searchFilter.classNames, "Object") >= 0;
				this.m_LastAssetStoreQueryClassName = ((!flag2) ? searchFilter.classNames : new string[0]);
				this.m_LastAssetStoreQueryLabels = ((searchFilter.assetLabels != null) ? searchFilter.assetLabels : new string[0]);
			}
			this.m_LastAssetStoreQueryChangeTime = EditorApplication.timeSinceStartup;
			this.m_RequeryAssetStore = true;
			this.m_ShowLocalAssetsOnly = (flag || searchFilter.GetState() != SearchFilter.State.SearchingInAssetStore);
			this.m_AssetStoreError = string.Empty;
			if (checkThumbnails)
			{
				this.m_AllowThumbnails = this.ObjectsHaveThumbnails(hierarchyType, searchFilter);
			}
			else
			{
				this.m_AllowThumbnails = true;
			}
			this.Repaint();
			this.ClearCroppedLabelCache();
			this.SetupData(true);
		}
示例#14
0
 public void SetType(HierarchyType type, Guid clsid, bool isProject)
 {
     Type      = type;
     CLSID     = clsid;
     IsProject = isProject;
 }
 public HierarchyAttribute(HierarchyType itemType)
     : this(itemType, null)
 {
 }
 public override void UpdateFilter(HierarchyType hierarchyType, SearchFilter searchFilter, bool showFoldersFirst)
 {
   this.ItemsWantedShown = !this.ListMode ? 3 * this.m_Grid.columns : 10;
   this.Assets.Clear();
 }
 public void Init(Rect rect, HierarchyType hierarchyType, SearchFilter searchFilter, bool checkThumbnails)
 {
   this.m_TotalRect = this.m_VisibleRect = rect;
   this.m_LocalAssets.UpdateFilter(hierarchyType, searchFilter, this.foldersFirst);
   this.m_LocalAssets.UpdateAssets();
   using (List<ObjectListArea.AssetStoreGroup>.Enumerator enumerator = this.m_StoreAssets.GetEnumerator())
   {
     while (enumerator.MoveNext())
       enumerator.Current.UpdateFilter(hierarchyType, searchFilter, this.foldersFirst);
   }
   bool flag = searchFilter.GetState() == SearchFilter.State.FolderBrowsing;
   if (flag)
   {
     this.m_LastAssetStoreQuerySearchFilter = string.Empty;
     this.m_LastAssetStoreQueryClassName = new string[0];
     this.m_LastAssetStoreQueryLabels = new string[0];
   }
   else
   {
     this.m_LastAssetStoreQuerySearchFilter = searchFilter.nameFilter != null ? searchFilter.nameFilter : string.Empty;
     this.m_LastAssetStoreQueryClassName = searchFilter.classNames != null && Array.IndexOf<string>(searchFilter.classNames, "Object") < 0 ? searchFilter.classNames : new string[0];
     this.m_LastAssetStoreQueryLabels = searchFilter.assetLabels != null ? searchFilter.assetLabels : new string[0];
   }
   this.m_LastAssetStoreQueryChangeTime = EditorApplication.timeSinceStartup;
   this.m_RequeryAssetStore = true;
   this.m_ShowLocalAssetsOnly = flag || searchFilter.GetState() != SearchFilter.State.SearchingInAssetStore;
   this.m_AssetStoreError = string.Empty;
   this.m_AllowThumbnails = !checkThumbnails || this.ObjectsHaveThumbnails(hierarchyType, searchFilter);
   this.Repaint();
   this.ClearCroppedLabelCache();
   this.SetupData(true);
 }
示例#18
0
 public Hierarchy(string name, string code, long spId, long?industryId, long?parentId, long customerId, HierarchyType hierarchyType)
     : this(name, code, spId, parentId, customerId, hierarchyType)
 {
     this.IndustryId = industryId;
 }
示例#19
0
 private static void ConvertHierarchy(ArticyData articyData, HierarchyType hierarchy)
 {
     articyData.hierarchy.node = ConvertNode(hierarchy.Node);
 }
示例#20
0
        /* Function: FromParameters
         * Creates a ClassString from the passed parameters.
         */
        static public ClassString FromParameters(HierarchyType hierarchy, int languageID, bool caseSensitive, SymbolString symbol)
        {
            if (symbol == null)
            {
                throw new NullReferenceException();
            }

            // SymbolString plus hierarchy, language ID, and separator.  It's almost definitely only going to use one char for the
            // language ID, but getting room for a second one just to be certain isn't a big deal when we're already paying for the
            // allocation.
            StringBuilder stringBuilder = new System.Text.StringBuilder(symbol.ToString().Length + 4);

            if (hierarchy == HierarchyType.Class)
            {
                if (caseSensitive)
                {
                    stringBuilder.Append('C');
                }
                else
                {
                    stringBuilder.Append('c');
                }
            }
            else             // (hierarchy == HierarchyType.Database)
            {
                if (caseSensitive)
                {
                    stringBuilder.Append('D');
                }
                else
                {
                    stringBuilder.Append('d');
                }
            }

            do
            {
                int value = languageID & 0x0000003F;

                if (value < 10)
                {
                    stringBuilder.Append((char)('0' + value));
                }
                else if (value < 36)
                {
                    stringBuilder.Append((char)('A' + (value - 10)));
                }
                else if (value < 62)
                {
                    stringBuilder.Append((char)('a' + (value - 36)));
                }
                else if (value == 62)
                {
                    stringBuilder.Append('!');
                }
                else                 // (value == 63)
                {
                    stringBuilder.Append('@');
                }

                languageID >>= 6;
            }while (languageID > 0);

            stringBuilder.Append(SeparatorChar);

            string symbolString = symbol.ToString();

            stringBuilder.Append(symbolString);

            string classString = stringBuilder.ToString();
            string lookupKey;

            if (caseSensitive)
            {
                lookupKey = classString;
            }
            else
            {
                stringBuilder.Remove(stringBuilder.Length - symbolString.Length, symbolString.Length);
                stringBuilder.Append(symbolString.ToLower());
                lookupKey = stringBuilder.ToString();
            }

            return(new ClassString(classString, lookupKey));
        }
 public override void UpdateFilter(HierarchyType hierarchyType, SearchFilter searchFilter, bool showFoldersFirst)
 {
     ItemsWantedShown = ListMode ? kDefaultRowsShownListMode : (kDefaultRowsShown * m_Grid.columns);
     Assets.Clear();
 }
示例#22
0
 // Called when the filter has changed
 abstract public void UpdateFilter(HierarchyType hierarchyType, SearchFilter searchFilter, bool showFoldersFirst);
示例#23
0
 public HierarchyInfo(SelectQuery masterQuery, HierarchyType hierarchyType, IQueryElement?parentElement)
 {
     MasterQuery   = masterQuery;
     HierarchyType = hierarchyType;
     ParentElement = parentElement;
 }
 public HierarchyProperty(HierarchyType hierarchytType);
示例#25
0
 public HierarchyProperty(HierarchyType type)
 {
 }
示例#26
0
 // Called when the filter has changed
 abstract public void UpdateFilter(HierarchyType hierarchyType, SearchFilter searchFilter, bool showFoldersFirst, SearchService.SearchSessionOptions searchSessionOptions);
示例#27
0
 public FilteredHierarchy(HierarchyType type)
 {
     this.m_HierarchyType = type;
 }
示例#28
0
 public void UpdateFilter(HierarchyType hierarchyType, SearchFilter searchFilter, bool showFoldersFirst)
 {
     UpdateFilter(hierarchyType, searchFilter, showFoldersFirst, SearchService.SearchSessionOptions.Default);
 }
 public HierarchyProperty(HierarchyType hierarchyType, bool forceImport)
     : this(hierarchyType, "Assets", forceImport)
 {
 }
 public extern HierarchyProperty(HierarchyType hierarchytType);
 static extern IntPtr Internal_Create(HierarchyType hierarchyType, string rootPath, bool forceImport);
示例#32
0
 public extern HierarchyProperty(HierarchyType hierarchyType, bool forceImport);
 public abstract void UpdateFilter(HierarchyType hierarchyType, SearchFilter searchFilter, bool showFoldersFirst);
示例#34
0
 public Callback(HierarchyType hierarchyType,
                 ref MindmanagerApplication mindManager)
 {
     _hierarchyType = hierarchyType;
     _mindManager   = mindManager;
 }
 public override void UpdateFilter(HierarchyType hierarchyType, SearchFilter searchFilter, bool foldersFirst)
 {
   this.RefreshHierarchy(hierarchyType, searchFilter, foldersFirst);
   this.RefreshBuiltinResourceList(searchFilter);
 }
 public FilteredHierarchy(HierarchyType type)
 {
     m_HierarchyType        = type;
     m_SearchSessionOptions = SearchService.SearchSessionOptions.Default;
 }
 private bool ObjectsHaveThumbnails(HierarchyType type, SearchFilter searchFilter)
 {
   if (this.m_LocalAssets.HasBuiltinResources)
     return true;
   IHierarchyProperty propertyForFilter = FilteredHierarchyProperty.CreateHierarchyPropertyForFilter(new FilteredHierarchy(type)
   {
     searchFilter = searchFilter
   });
   int[] expanded = new int[0];
   if (propertyForFilter.CountRemaining(expanded) == 0)
     return true;
   propertyForFilter.Reset();
   while (propertyForFilter.Next(expanded))
   {
     if (propertyForFilter.hasFullPreviewImage)
       return true;
   }
   return false;
 }
 public FilteredHierarchy(HierarchyType type, SearchService.SearchSessionOptions searchSessionOptions)
 {
     m_HierarchyType        = type;
     m_SearchSessionOptions = searchSessionOptions;
 }
示例#39
0
 public extern HierarchyProperty(HierarchyType hierarchytType);
 public HierarchyProperty(HierarchyType hierarchytType);