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


C# ListView.GetType方法代码示例

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


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

示例1: propPrinter

 // DEBUGGING
 private void propPrinter(string fileLoc, ListView l)
 {
     string s = String.Empty;
     foreach (var prop in l.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public))
     {
         if (prop.Name != "TopItem")
         {
             if (prop.GetValue(l, null) != null)
                 s += (prop.Name + " = " + prop.GetValue(l, null).ToString() + Environment.NewLine);
         }
     }
     using (StreamWriter sWr = new StreamWriter(fileLoc))
     {
         sWr.Write(s);
     }
 }
开发者ID:quirkydragon,项目名称:IBTRecord,代码行数:17,代码来源:PrintOptions.cs

示例2: EnableDoubleBuffering

        void EnableDoubleBuffering(ListView listView)
        {
            if (listView == null)
                return;

            var doubleBufferedProperty = listView.GetType().GetProperty(
                "DoubleBuffered",
                System.Reflection.BindingFlags.NonPublic | BindingFlags.Instance
            );

            if (doubleBufferedProperty == null)
                return;

            doubleBufferedProperty.SetValue(listView, true, null);
        }
开发者ID:schmich,项目名称:debuggernaut,代码行数:15,代码来源:MainForm.cs

示例3: CorrectEventsForListView

        /// <summary>
        /// Patches the events for a specific ListView.
        /// </summary>
        /// <param name="lView">The source ListView.</param>
        private static void CorrectEventsForListView(ListView lView)
        {
            Delegate[] EventDelegates = null;

            if (EventsPatched.ContainsKey(lView))
                throw new InvalidOperationException("Events for this list view has been previously patched: '" + lView.Name + "'");

            EventsPatched.Add(lView, new Dictionary<string, List<Delegate>>());
            foreach (string eventName in EventsToCorrect.Keys)
            {
                EventInfo eInfo = lView.GetType().GetEvent(eventName);
                if (eInfo == null)
                    throw new InvalidOperationException("Event info for event '" + eventName + "' could not be found");

                EventsPatched[lView].Add(eventName, new List<Delegate>());
                EventDelegates = ContainerHelper.GetEventSubscribers(lView, eventName);
                if (EventDelegates != null)
                {

                    foreach (Delegate del in EventDelegates)
                    {
                        EventsPatched[lView][eventName].Add(del);
                        eInfo.RemoveEventHandler(lView, del);
                    }
                }
                eInfo.AddEventHandler(lView, EventsToCorrect[eventName]);
            }
        }
开发者ID:WebMAPTestUser,项目名称:SKS,代码行数:32,代码来源:ListViewHelper.cs

示例4: PatchDrawItemEvents

        /// <summary>
        /// In order to handle the property SmallIcons of a ListItem some Draw events must be handled.
        /// </summary>
        /// <param name="lView">The ListView source.</param>
        private static void PatchDrawItemEvents(ListView lView)
        {
            Delegate[] EventDelegates = null;
            bool PatchDrawItem = true;
            bool PatchDrawSubItem = true;
            bool PatchDrawColumnHeader = true;
            EventInfo eInfo = null;

            if (EventsPatched.ContainsKey(lView))
            {
                //The events were previously patched
                if (EventsPatched[lView].ContainsKey(DrawItemEventName))
                    PatchDrawItem = false;

                if (EventsPatched[lView].ContainsKey(DrawColumnHeaderEventName))
                    PatchDrawColumnHeader = false;

                if (EventsPatched[lView].ContainsKey(DrawSubItemEventName))
                    PatchDrawSubItem = false;
            }
            else
                EventsPatched.Add(lView, new Dictionary<string, List<Delegate>>());

            if (PatchDrawItem)
            {
                eInfo = lView.GetType().GetEvent(DrawItemEventName);
                if (eInfo == null)
                    throw new InvalidOperationException("Event info for event '" + DrawItemEventName + "' could not be found");

                EventsPatched[lView].Add(DrawItemEventName, new List<Delegate>());
                EventDelegates = ContainerHelper.GetEventSubscribers(lView, DrawItemEventName);
                if (EventDelegates != null)
                {
                    foreach (Delegate del in EventDelegates)
                    {
                        EventsPatched[lView][DrawItemEventName].Add(del);
                        eInfo.RemoveEventHandler(lView, del);
                    }
                }
                lView.DrawItem += new System.Windows.Forms.DrawListViewItemEventHandler(ListView_DrawItem);
            }

            if (PatchDrawColumnHeader)
            {
                eInfo = lView.GetType().GetEvent(DrawColumnHeaderEventName);
                if (eInfo == null)
                    throw new InvalidOperationException("Event info for event '" + DrawColumnHeaderEventName + "' could not be found");

                EventsPatched[lView].Add(DrawColumnHeaderEventName, new List<Delegate>());
                EventDelegates = ContainerHelper.GetEventSubscribers(lView, DrawColumnHeaderEventName);
                if (EventDelegates != null)
                {
                    foreach (Delegate del in EventDelegates)
                    {
                        EventsPatched[lView][DrawColumnHeaderEventName].Add(del);
                        eInfo.RemoveEventHandler(lView, del);
                    }
                }
                lView.DrawColumnHeader += new System.Windows.Forms.DrawListViewColumnHeaderEventHandler(ListView_DrawColumnHeader);
            }

            if (PatchDrawSubItem)
            {
                eInfo = lView.GetType().GetEvent(DrawSubItemEventName);
                if (eInfo == null)
                    throw new InvalidOperationException("Event info for event '" + DrawSubItemEventName + "' could not be found");

                EventsPatched[lView].Add(DrawSubItemEventName, new List<Delegate>());
                EventDelegates = ContainerHelper.GetEventSubscribers(lView, DrawSubItemEventName);
                if (EventDelegates != null)
                {
                    foreach (Delegate del in EventDelegates)
                    {
                        EventsPatched[lView][DrawSubItemEventName].Add(del);
                        eInfo.RemoveEventHandler(lView, del);
                    }
                }
                lView.DrawSubItem += new DrawListViewSubItemEventHandler(ListView_DrawSubItem);
            }

            lView.OwnerDraw = true;
        }
开发者ID:WebMAPTestUser,项目名称:SKS,代码行数:86,代码来源:ListViewHelper.cs

示例5: GetListViewState

 static string GetListViewState(ListView listview)
 {
     return listview.GetType().ToString() + ":" + ListViewUtil.GetColumnWidthListString(listview);
 }
开发者ID:paopaofeng,项目名称:dp2,代码行数:4,代码来源:GuiState.cs


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