• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ItemIdentifier类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ItemIdentifier的典型用法代码示例。如果您正苦于以下问题:C# ItemIdentifier类的具体用法?C# ItemIdentifier怎么用?C# ItemIdentifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ItemIdentifier类属于命名空间,在下文中一共展示了ItemIdentifier类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetTagCanonicalType

        private Int16 GetTagCanonicalType(string itemName)
        {
            const int ItemCanonicalDataTypeProperty = 1;

            TreeNode rootNode = uiGroupsTab_AllFoldersTreeView.SelectedNode;
            while (rootNode.Parent != null)
            {
                rootNode = rootNode.Parent;
            }

            var opcServer = Settings.OpcServers.Where(os => rootNode.FullPath == os.ServerName).Single();
            string urlstring = opcServer.URL;
            Server server = new Server(new Factory(), new URL(urlstring));
            server.Connect();

            ItemIdentifier [] itemIdentifiers = new ItemIdentifier[] {new ItemIdentifier(itemName)};
            PropertyID[] propertyIDs = new PropertyID[] { new PropertyID(ItemCanonicalDataTypeProperty) };

            var result = server.GetProperties(itemIdentifiers, propertyIDs, true);

            server.Disconnect();

            var resultType = result[0][0].Value.GetType();
            PropertyInfo nameProperty = resultType.GetProperty("Name");
            string name = nameProperty.GetValue(result[0][0].Value, null) as string;

            switch (name.ToLower())
            {
                case "string":
                case "char":
                    return 0;
                case "int16":
                case "int32":
                case "int64":
                case "uint16":
                case "uint32":
                case "uint64":
                    return 1;
                case "boolean":
                    return 2;
                case "decimal":
                case "double":
                    return 3;
                case "datetime":
                case "datetimeoffset":
                    return 4;
                default:
                    return 0;
            }
        }
开发者ID:densem-2013,项目名称:Chron,代码行数:50,代码来源:GroupsTab.cs


示例2: ShouldExecute

        public override bool ShouldExecute(Type itemType, ItemIdentifier itemId, Resource resource, Core.Enums.ItemEvent eventType)
        {
            if (itemType == typeof(Template) && resource.PackageFromPath.ToLower().EndsWith(".master")  )
                return true;

            return false;
        }
开发者ID:jayvin,项目名称:Courier,代码行数:7,代码来源:TemplateResources.cs


示例3: PackagedResource

        public override void PackagedResource(Type itemType, ItemIdentifier itemId, Resource resource)
        {           
            {
                var item = PersistenceManager.Default.RetrieveItem<Template>(itemId);
                var encoding = Core.Settings.Encoding;

                var contents = resource.ResourceContents;
                string fileContent = string.Empty;

                if (contents == null || contents.Length <= 0)
                {
                    string p = Context.Current.MapPath(resource.PackageFromPath);

                    if (System.IO.File.Exists(p))
                    {
                        contents = System.IO.File.ReadAllBytes(p);
                        fileContent = encoding.GetString(contents);
                    }
                }
                else
                    fileContent = encoding.GetString(contents);

                if (fileContent != string.Empty)
                {

                    fileContent = ReplaceMacrosInstring(fileContent, true, item);
                    resource.ResourceContents = encoding.GetBytes(fileContent);
                }
            }
        }
开发者ID:jayvin,项目名称:Courier,代码行数:30,代码来源:MacroParameters.cs


示例4: Execute

 public override void Execute(ItemIdentifier itemId, SerializableDictionary<string, string> Parameters)
 {
     try
     {
         Cache.ClearCacheByKeySearch("UmbracoDataTypeDefinition");
     }
     catch (Exception ex)
     {
         RevisionLog.Instance.AddItemEntry(itemId, this.GetType(), "ClearDataTypeCache", ex.ToString(), LogItemEntryType.Error);
     }
 }
开发者ID:jayvin,项目名称:Courier,代码行数:11,代码来源:RefreshDataTypeCache.cs


示例5: HandlePack

        public override Item HandlePack(ItemIdentifier id)
        {
            Company item = this.DatabasePersistence.RetrieveItem<Company>(id);

            //here we could also add dependencies or resources
            //item.Resources.Add("/file/path/to/something.jpg");

            //Dependency dep = new Dependency("Something that needs to be installed before company is" "id", new Guid());
            //item.Dependencies.Add(dep);

            return item;
        }
开发者ID:jayvin,项目名称:Courier,代码行数:12,代码来源:CompanyItemProvider.cs


示例6: Packaging

        public override void Packaging(Item item)
        {
            ContentPropertyData cpd = (ContentPropertyData)item;
            foreach (var cp in cpd.Data)
            {
                if (keyValuePrevalueEditors.Values.Contains(cp.PreValueEditor.ToLower()) && cp.Value != null)
                {
                    string[] vals = cp.Value.ToString().Split(',');
                    string newVals = string.Empty;

                    ItemIdentifier itemid = new ItemIdentifier(cp.DataType.ToString(), ProviderIDCollection.dataTypeItemProviderGuid);
                    DataType dt = PersistenceManager.Default.RetrieveItem<DataType>(itemid);

                    bool nonConvert = false;
                    int convertTestVal = 0;
                    if (!int.TryParse(string.Join("", vals), out convertTestVal))
                        nonConvert = true;

                    if (dt != null)
                    {
                        foreach (string s in vals)
                        {
                            int id;
                            if (int.TryParse(s, out id))
                            {
                                if (id > 0)
                                {
                                    var val = dt.Prevalues.Where(x => x.Id == id).FirstOrDefault();
                                    if (val != null)
                                        newVals += val.Value + ",";
                                }
                            }
                            else if(dt.Prevalues.Where(x => x.Value == s).Any())
                            {
                                newVals += s + ",";
                            }
                        }

                        newVals = newVals.Trim(',');

                        //this is a nasty hack but no way around it due to the idiotic way keyvalue types can store stuff
                        if (nonConvert)
                            newVals = "¤" + newVals;

                        cp.Value = newVals;
                    }
                }
            }
        }
开发者ID:jayvin,项目名称:Courier,代码行数:49,代码来源:KeyValuePrevalueEditor.cs


示例7: Extract

        public RepositoryActionResponse Extract(string sessionKey, byte[] item, ItemIdentifier itemId, bool overwrite, string user, string pass)
        {
            //Auth login and IP
            AuthorizeClient(user, pass);

            var p = ItemProviderCollection.Instance.GetProvider(itemId.ProviderId);
            var i = p.Deserialize(itemId, item);

            if (string.IsNullOrEmpty(sessionKey))
                sessionKey = "default";

            LocalRepo.SessionKey = sessionKey;
            var status = LocalRepo.ExtractItem(i, overwrite);

            return status;
        }
开发者ID:jayvin,项目名称:Courier,代码行数:16,代码来源:CourierRepository.asmx.cs


示例8: ExtractingResource

        public override void ExtractingResource(Type itemType, ItemIdentifier itemId, Resource resource)
        { 
                var item = PersistenceManager.Default.RetrieveItem<Template>(itemId);
                var encoding = Core.Settings.Encoding;

                var contents = resource.ResourceContents;

                if (contents != null && contents.Length > 0)
                {
                    string fileContent = encoding.GetString(contents);

                    if (!string.IsNullOrEmpty(fileContent))
                    {
                        fileContent = ReplaceMacrosInstring(fileContent, false, item);
                        resource.ResourceContents = encoding.GetBytes(fileContent);
                    }
                }
            
        }
开发者ID:jayvin,项目名称:Courier,代码行数:19,代码来源:MacroParameters.cs


示例9: PackagedResource

        public override void PackagedResource(Type itemType, ItemIdentifier itemId, Resource resource)
        {
            var fileContent = ResourceAsString(resource);
                if (fileContent != string.Empty)
                {
                        //macros
                        Helpers.MacroResolver res = new Helpers.MacroResolver();
                        res.RegisterNodeDependencies = false;
                        res.RegisterMacroDependencies = false;
                        res.context = this.ExecutionContext;

                        fileContent = res.ReplaceMacroElements(fileContent, true, null);

                        //links
                        Helpers.LocalLinkResolver les = new Helpers.LocalLinkResolver();
                        les.RegisterLinksAsDependencies = false;
                        fileContent = les.ReplaceLocalLinks(fileContent, true, null);

                        resource.ResourceContents = Core.Settings.Encoding.GetBytes(fileContent);
                }
        }
开发者ID:jayvin,项目名称:Courier,代码行数:21,代码来源:TemplateResources.cs


示例10: ReindexContent

        private void ReindexContent(Guid contentGuid, ItemIdentifier itemId)
        {
            umbraco.cms.businesslogic.web.Document d = new umbraco.cms.businesslogic.web.Document(contentGuid);
            if (d != null)
            {
                XmlNode n = d.ToXml(new XmlDocument(), true);
                if (n != null)
                {
                    XElement docXnode = XDocument.Parse(n.OuterXml).Root;
                    if (d.Published)
                    {
                        //only if published should it be added to indexes which doesnt support published content
                        try
                        {
                            ExamineManager.Instance.ReIndexNode(docXnode, IndexTypes.Content,
                               ExamineManager.Instance.IndexProviderCollection.OfType<BaseUmbracoIndexer>()
                                   .Where(x => x.EnableDefaultEventHandler));
                        }
                        catch (Exception ex)
                        {
                            RevisionLog.Instance.AddItemEntry(itemId, this.GetType(), "UpdateLuceneIndexes", ex.ToString(), LogItemEntryType.Error);
                        }
                    }

                    //add to all indexes supporting unpublished content
                    try
                    {
                        ExamineManager.Instance.ReIndexNode(docXnode, IndexTypes.Content,
                           ExamineManager.Instance.IndexProviderCollection.OfType<BaseUmbracoIndexer>()
                               .Where(x => x.SupportUnpublishedContent
                                   && x.EnableDefaultEventHandler));
                    }
                    catch (Exception ex)
                    {
                        RevisionLog.Instance.AddItemEntry(itemId, this.GetType(), "UpdateLuceneIndexes", ex.ToString(), LogItemEntryType.Error);
                    }
                }
            }
        }
开发者ID:jayvin,项目名称:Courier,代码行数:39,代码来源:UpdateLuceneIndexes.cs


示例11: Extracting

        public override void Extracting(Item item)
        {
            ContentPropertyData cpd = (ContentPropertyData)item;
            foreach (var cp in cpd.Data)
            {
                if (keyValuePrevalueEditors.Values.Contains(cp.PreValueEditor.ToLower()) && cp.Value != null)
                {
                    //nonConvert indicator
                    string value = cp.Value.ToString();
                    bool nonConvert = value.StartsWith("¤");
                    value = value.TrimStart('¤');

                    string[] vals = value.Split(',');
                    string newVals = string.Empty;

                    ItemIdentifier itemid = new ItemIdentifier(cp.DataType.ToString(), ProviderIDCollection.dataTypeItemProviderGuid);

                    if (nonConvert)
                        cp.Value = value.Trim(',');
                    else
                    {
                        DataType dt = PersistenceManager.Default.RetrieveItem<DataType>(itemid);
                        if (dt != null)
                        {
                            foreach (string s in vals)
                            {
                                var val = dt.Prevalues.Where(x => x.Value == s).FirstOrDefault();
                                if (val != null)
                                {
                                    newVals += val.Id.ToString() + ",";
                                }
                            }
                            cp.Value = newVals.Trim(',');
                        }
                    }
                }
            }
        }
开发者ID:jayvin,项目名称:Courier,代码行数:38,代码来源:KeyValuePrevalueEditor.cs


示例12: SelectItemUp

		void SelectItemUp ()
		{
			if (selectedItem == null || selectedItem == topItem)
				return;
			int i = SelectedCategoryIndex;
			if (selectedItem.Item > 0) {
				selectedItem = new ItemIdentifier (selectedItem.Category, selectedItem.DataSource, selectedItem.Item - 1);
				if (i > 0 && selectedItem.Equals (topItem)) {
					SelectItemUp ();
					return;
				}
			} else {
				if (i == 0) {
					selectedItem = topItem;
				} else {
					do {
						i--;
						selectedItem = new ItemIdentifier (
							results [i].Item1,
							results [i].Item2,
							Math.Min (maxItems, results [i].Item2.ItemCount) - 1
						);
						if (selectedItem.Category == topItem.Category && selectedItem.Item == topItem.Item && i > 0) {
							i--;
							selectedItem = new ItemIdentifier (
								results [i].Item1,
								results [i].Item2,
								Math.Min (maxItems, results [i].Item2.ItemCount) - 1
							);
						}
							
					} while (i > 0 && selectedItem.DataSource.ItemCount <= 0);

					if (selectedItem.DataSource.ItemCount <= 0) {
						selectedItem = topItem;
					}
				}
			}
			ShowTooltip ();
			QueueDraw ();
		}
开发者ID:KrazyPengwin,项目名称:monodevelop,代码行数:41,代码来源:SearchPopupWindow.cs


示例13: ShowResult

		void ShowResult (SearchCategory cat, ISearchDataSource result)
		{
			incompleteResults.Add (Tuple.Create (cat, result));

			incompleteResults.Sort ((x, y) => {
				return categories.IndexOf (x.Item1).CompareTo (categories.IndexOf (y.Item1));
			}
			);

			if (incompleteResults.Count == categories.Count) {
				results.Clear ();
				results.AddRange (incompleteResults);
				List<Tuple<SearchCategory, ISearchDataSource>> failedResults = null;
				topItem = null;

				for (int i = 0; i < results.Count; i++) {
					var tuple = results [i];
					try {
						if (tuple.Item2.ItemCount == 0)
							continue;
						if (topItem == null || topItem.DataSource.GetWeight (topItem.Item) < tuple.Item2.GetWeight (0))
							topItem = new ItemIdentifier(tuple.Item1, tuple.Item2, 0);
					} catch (Exception e) {
						LoggingService.LogError ("Error while showing result " + i, e);
						if (failedResults == null)
							failedResults = new List<Tuple<SearchCategory, ISearchDataSource>> ();
						failedResults.Add (results [i]);
						continue;
					}
				}
				selectedItem = topItem;

				if (failedResults != null)
					failedResults.ForEach (failedResult => results.Remove (failedResult));

				ShowTooltip ();
				isInSearch = false;
				AnimatedResize ();
			}
		}
开发者ID:KrazyPengwin,项目名称:monodevelop,代码行数:40,代码来源:SearchPopupWindow.cs


示例14: ShowResults

		void ShowResults (List<Tuple<SearchCategory, IReadOnlyList<SearchResult>>> newResults, ItemIdentifier topResult)
		{
			results = newResults;
			selectedItem = topItem = topResult;
			ShowTooltip ();
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:6,代码来源:SearchPopupWindow.cs


示例15: Update

		public void Update (SearchPopupSearchPattern pattern)
		{
			// in case of 'string:' it's not clear if the user ment 'tag:pattern'  or 'pattern:line' therefore guess
			// 'tag:', if no valid tag is found guess 'pattern:'
			if (!string.IsNullOrEmpty (pattern.Tag) && string.IsNullOrEmpty (pattern.Pattern) && !categories.Any (c => c.IsValidTag (pattern.Tag))) {
				pattern = new SearchPopupSearchPattern (null, pattern.Tag, pattern.LineNumber, pattern.Column, pattern.UnparsedPattern);
			}

			this.pattern = pattern;
			if (src != null)
				src.Cancel ();
			HideTooltip ();
			src = new CancellationTokenSource ();
			isInSearch = true;
			if (results.Count == 0) {
				QueueDraw ();
			}
			var collectors = new List<SearchResultCollector> ();
			var token = src.Token;
			foreach (var _cat in categories) {
				var cat = _cat;
				if (!string.IsNullOrEmpty (pattern.Tag) && !cat.IsValidTag (pattern.Tag))
					continue;
				var col = new SearchResultCollector (_cat);
				collectors.Add (col);
				col.Task = cat.GetResults (col, pattern, token);
			}

			Task.WhenAll (collectors.Select (c => c.Task)).ContinueWith (t => {
				if (token.IsCancellationRequested)
					return;
				var newResults = new List<Tuple<SearchCategory, IReadOnlyList<SearchResult>>> (collectors.Count);
				foreach (var col in collectors) {
					if (col.Task.IsCanceled) {
						continue;
					} else if (col.Task.IsFaulted) {
						LoggingService.LogError ($"Error getting search results for {col.Category}", col.Task.Exception);
					} else {
						newResults.Add (Tuple.Create (col.Category, col.Results));
					}
				}

				List<Tuple<SearchCategory, IReadOnlyList<SearchResult>>> failedResults = null;
				ItemIdentifier topResult = null;
				for (int i = 0; i < newResults.Count; i++) {
					var tuple = newResults [i];
					try {
						if (tuple.Item2.Count == 0)
							continue;
						if (topResult == null || topResult.DataSource [topResult.Item].Weight < tuple.Item2 [0].Weight)
							topResult = new ItemIdentifier (tuple.Item1, tuple.Item2, 0);
					} catch (Exception e) {
						LoggingService.LogError ("Error while showing result " + i, e);
						if (failedResults == null)
							failedResults = new List<Tuple<SearchCategory, IReadOnlyList<SearchResult>>> ();
						failedResults.Add (newResults [i]);
						continue;
					}
				}

				if (failedResults != null)
					failedResults.ForEach (failedResult => newResults.Remove (failedResult));

				Application.Invoke (delegate {
					ShowResults (newResults, topResult);
					isInSearch = false;
					AnimatedResize ();
				});
			}, token);
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:70,代码来源:SearchPopupWindow.cs


示例16: ShowResult

		void ShowResult (SearchCategory cat, ISearchDataSource result)
		{
			incompleteResults.Add (Tuple.Create (cat, result));

			incompleteResults.Sort ((x, y) => {
				return categories.IndexOf (x.Item1).CompareTo (categories.IndexOf (y.Item1));
			}
			);

			if (incompleteResults.Count == categories.Count) {
				results.Clear ();
				results.AddRange (incompleteResults);
				topItem = null;
				for (int i = 0; i < results.Count; i++) {
					if (results[i].Item2.ItemCount == 0)
						continue;
					if (topItem == null || topItem.DataSource.GetWeight (topItem.Item) <  results[i].Item2.GetWeight (0)) 
						topItem = new ItemIdentifier (results[i].Item1, results[i].Item2, 0);
				}
				selectedItem = topItem;

				ShowTooltip ();
				isInSearch = false;
				AnimatedResize ();
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:26,代码来源:SearchPopupWindow.cs


示例17: BuildBTree

        static dynamic BuildBTree(ItemIdentifier root)
        {
            Cursor origCursor = Cursor.Current;
            IVsThreadedWaitDialog2 dlg = null;
            bool bcanceled;
            int icanceled, idx = 0;
            DateTime minDate = DateTime.MaxValue, maxDate = DateTime.MinValue;

            Cursor.Current = Cursors.WaitCursor;

            dlg = Utilities.CreateThreadedWaitDialog("Collecting information about changesets", "Starting to process changesets...", "status", 100);
            dlg.UpdateProgress("Collecting information about changesets", "Starting to process changesets...", "status", 0, 100, true, out bcanceled);

            var branches = new List<BTreeItem>();
            foreach (var item in Utilities.vcsrv.QueryRootBranchObjects(RecursionType.Full))
            {
                var itm = new BTreeItem
                {
                    Path = item.Properties.RootItem.Item,
                    CreationDate = item.DateCreated,
                    parentPath = item.Properties.ParentBranch == null ? null : item.Properties.ParentBranch.Item,
                    version = (item.Properties.RootItem.Version as ChangesetVersionSpec).ChangesetId,
                    RelatedBranches = Utilities.vcsrv
                        .QueryMergeRelationships(item.Properties.RootItem.Item)
                        .Select(x => new Tuple<BTreeItem, Changeset[]>(new BTreeItem { Path = x.Item }, Utilities.vcsrv
                                .GetMergeCandidates(item.Properties.RootItem.Item, x.Item, RecursionType.Full)
                                .Select(z => z.Changeset).ToArray()))
                        .ToList()
                };

                if (itm.CreationDate < minDate) minDate = itm.CreationDate;
                if (itm.CreationDate > maxDate) maxDate = itm.CreationDate;
                branches.Add(itm);

                dlg.UpdateProgress("Collecting information about changesets", "Processing branch: " + itm.Path, "status", idx++, 100, false, out bcanceled);
                if (bcanceled) break;
            }

            var broot = new BTreeItem();
            foreach(var itm in branches)
            {
                if (itm.parentPath == null)
                {
                    broot.children.Add(itm);
                    itm.parent = broot;
                }
                else
                {
                    itm.parent = branches.FirstOrDefault(x => x.Path == itm.parentPath);
                    if (itm.parent != null)
                        itm.parent.children.Add(itm);
                    else
                        broot.children.Add(itm);
                }

                itm.RelatedBranches = itm.RelatedBranches
                    .Select(x => new Tuple<BTreeItem, Changeset[]>(branches.FirstOrDefault(z => z.Path == x.Item1.Path), x.Item2))
                    .ToList();

                itm.relY = (int)itm.CreationDate.Subtract(minDate).TotalDays;

                foreach (var ch in itm.RelatedBranches.SelectMany(x => x.Item2))
                    if (ch.CreationDate > maxDate) maxDate = ch.CreationDate;
            }

            idx = 0;
            var res = ShowRevHistPackage.TreeDescendants2(broot, ref idx).OrderBy(x => x.relX).ToList();
            res.ForEach(x => Utilities.OutputCommandString(x.relX + " " + (x.parentPath ?? "") + "=" + x.DisplayText));

            Cursor.Current = origCursor;
            dlg.EndWaitDialog(out icanceled);

            return new {
                ylines = (int)(maxDate.Subtract(minDate).TotalDays * 1.1) + 1,
                xlines = idx+1,
                branches = res
            };
        }
开发者ID:mirik123,项目名称:tfsprod,代码行数:78,代码来源:ShowRevHistPackage.cs


示例18: GetResourceContents

        public byte[] GetResourceContents(ItemIdentifier itemId, Type itemType, Resource resource, string revisionAlias)
        {
            if (revisionAlias != null)
            {

                //check if the resource has already been packaged before
                resource.ResourceContents = resource.ToByteArray(Core.Settings.revisionsPath + "/" + revisionAlias + "/" +
                                                                    Core.Settings.ResourcesFolderName);
                if (resource.ResourceContents != null)
                    return resource.ResourceContents;
            }

            ItemProvider provider = null;
            if (!string.IsNullOrEmpty(resource.ExtractToPath) && itemType != null)
            {
                provider = Umbraco.Courier.Core.ProviderModel.ItemProviderCollection.Instance.GetProvider(itemId.ProviderId, Database, ExecutionContext);
                ResolutionManager.Instance.PackagingResource(itemId, itemType, resource, provider);
            }

            resource.ResourceContents = resource.ToByteArray("~/");

            //if (!string.IsNullOrEmpty(resource.ExtractToPath) && itemType != null)
            //    ResolutionManager.Instance.PackagedResource(itemId, itemType, resource, provider);

            return resource.ResourceContents;
        }
开发者ID:jayvin,项目名称:Courier,代码行数:26,代码来源:LocalCleanedUp.cs


示例19: SelectPrevCategory

		void SelectPrevCategory ()
		{
			if (selectedItem == null)
				return;
			var i = SelectedCategoryIndex;
			if (i > 0) {
				selectedItem = new ItemIdentifier (
					results [i - 1].Item1,
					results [i - 1].Item2,
					0
				);
				if (selectedItem.Equals (topItem)) {
					if (topItem.DataSource.ItemCount > 1) {
						selectedItem = new ItemIdentifier (
							results [i - 1].Item1,
							results [i - 1].Item2,
							1
						);
					} else if (i > 1) {
						selectedItem = new ItemIdentifier (
							results [i - 2].Item1,
							results [i - 2].Item2,
							0
						);
					}
				}
			} else {
				selectedItem = topItem;
			}
			QueueDraw ();
		}
开发者ID:KrazyPengwin,项目名称:monodevelop,代码行数:31,代码来源:SearchPopupWindow.cs


示例20: SelectItemDown

		void SelectItemDown ()
		{
			if (selectedItem == null)
				return;

			if (selectedItem.Equals (topItem)) {
				for (int j = 0; j < results.Count; j++) {
					if (results[j].Item2.ItemCount == 0 || results[j].Item2.ItemCount == 1 && topItem.DataSource == results[j].Item2)
						continue;
					selectedItem = new ItemIdentifier (
						results [j].Item1,
						results [j].Item2,
						0
						);
					if (selectedItem.Equals (topItem))
						goto normalDown;
					break;
				}
				ShowTooltip ();
				QueueDraw ();
				return;
			}
		normalDown:
			var i = SelectedCategoryIndex;

			// check real upper bound
			if (selectedItem != null) {
				var curAbsoluteIndex = selectedItem == topItem ? 1 : 0;
				for (int j = 0; j < i; j++) {
					curAbsoluteIndex += Math.Min (maxItems, results [j].Item2.ItemCount);
				}
				curAbsoluteIndex += selectedItem.Item + 1;
				if (curAbsoluteIndex + 1 > calculatedItems)
					return;
			}

			var upperBound = Math.Min (maxItems, selectedItem.DataSource.ItemCount);
			if (selectedItem.Item + 1 < upperBound) {
				if (topItem.DataSource == selectedItem.DataSource && selectedItem.Item == upperBound - 1)
					return;
				selectedItem = new ItemIdentifier (selectedItem.Category, selectedItem.DataSource, selectedItem.Item + 1);
			} else {
				for (int j = i + 1; j < results.Count; j++) {
					if (results[j].Item2.ItemCount == 0 || results[j].Item2.ItemCount == 1 && topItem.DataSource == results[j].Item2)
						continue;
					selectedItem = new ItemIdentifier (
						results [j].Item1,
						results [j].Item2,
						0
						);
					if (selectedItem.Equals (topItem)) {
						selectedItem = new ItemIdentifier (
							results [j].Item1,
							results [j].Item2,
							1
							);
					}

					break;
				}
			}
			ShowTooltip ();
			QueueDraw ();
		}
开发者ID:KrazyPengwin,项目名称:monodevelop,代码行数:64,代码来源:SearchPopupWindow.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ItemInfo类代码示例发布时间:2022-05-24
下一篇:
C# ItemId类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap