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


C# IDesignerHost.GetHashCode方法代码示例

本文整理汇总了C#中IDesignerHost.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# IDesignerHost.GetHashCode方法的具体用法?C# IDesignerHost.GetHashCode怎么用?C# IDesignerHost.GetHashCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDesignerHost的用法示例。


在下文中一共展示了IDesignerHost.GetHashCode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoveCreator

        public void RemoveCreator(string format, IDesignerHost host)
        {
            if (format == null)
                throw new ArgumentNullException("format");

            if (customCreators != null)
            {
                string key = format;
                if (host != null)
                    key += ", " + host.GetHashCode().ToString();
                customCreators.Remove(key);
            }
        }
开发者ID:san90279,项目名称:UK_OAS,代码行数:13,代码来源:FLActivityToolbox.cs

示例2: FindToolboxItemCreator

        private ToolboxItemCreatorCallback FindToolboxItemCreator(IDataObject dataObj, IDesignerHost host, out string foundFormat)
        {
            foundFormat = string.Empty;

            ToolboxItemCreatorCallback creator = null;
            if (customCreators != null)
            {
                IEnumerator keys = customCreators.Keys.GetEnumerator();
                while (keys.MoveNext())
                {
                    string key = (string)keys.Current;
                    string[] keyParts = key.Split(new char[] { ',' });
                    string format = keyParts[0];

                    if (dataObj.GetDataPresent(format))
                    {
                        if (keyParts.Length == 1 || (host != null && host.GetHashCode().ToString().Equals(keyParts[1])))
                        {
                            creator = (ToolboxItemCreatorCallback)customCreators[format];
                            foundFormat = format;
                            break;
                        }
                    }
                }
            }

            return creator;
        }
开发者ID:san90279,项目名称:UK_OAS,代码行数:28,代码来源:FLActivityToolbox.cs

示例3: AddCreator

        public void AddCreator(ToolboxItemCreatorCallback creator, string format, IDesignerHost host)
        {
            if (creator == null || format == null)
            {
                throw new ArgumentNullException(creator == null ? "creator" : "format");
            }

            if (customCreators == null)
            {
                customCreators = new Hashtable();
            }
            else
            {
                string key = format;

                if (host != null) key += ", " + host.GetHashCode().ToString();

                if (customCreators.ContainsKey(key))
                {
                    throw new Exception("There is already a creator registered for the format '" + format + "'.");
                }
            }

            customCreators[format] = creator;
        }
开发者ID:san90279,项目名称:UK_OAS,代码行数:25,代码来源:FLActivityToolbox.cs


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