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

C# HandlingPriority类代码示例

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

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



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

示例1: HandleEvent

 public void HandleEvent(object sender, NotifyEvent e, HandlingPriority priority)
 {
     if (e.Type == EventType.ApplyTheme)
     {
         RefreshColors();
     }
 }
开发者ID:ImaginationSydney,项目名称:flashdevelop,代码行数:7,代码来源:ProjectTreeView.cs


示例2: HandleEvent

        public void HandleEvent(object sender, NotifyEvent e,
			HandlingPriority priority)
        {
            var de = e as DataEvent;

            // If it's a DE event with subs for the DE's action
            if (de != null && subs.ContainsKey (de.Action)) {
                subs[de.Action].ForEach (i => i (de));
            }
        }
开发者ID:NullSoldier,项目名称:Launchpad,代码行数:10,代码来源:EventRouter.cs


示例3: HandleEvent

 public void HandleEvent(object sender, NotifyEvent e, HandlingPriority priority)
 {
     switch (e.Type)
     {
         case EventType.Trace:
             ProcessTraces();
             ui.EndUpdate();
             break;
     }
 }
开发者ID:SlavaRa,项目名称:fdplugin-testexplorer,代码行数:10,代码来源:TraceHandler.cs


示例4: HandleEvent

 public void HandleEvent(object sender, NotifyEvent e, HandlingPriority priority)
 {
     switch (e.Type)
     {
         case EventType.ProcessStart:
             ui.BeginUpdate();
             break;
         case EventType.ProcessEnd:
             ui.EndUpdate();
             break;
     }
 }
开发者ID:SlavaRa,项目名称:fdplugin-testexplorer,代码行数:12,代码来源:ProcessEventHandler.cs


示例5: HandleEvent

 /// <summary>
 /// Handle the incoming theme events
 /// </summary>
 public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
 {
     if (e.Type == EventType.ApplyTheme)
     {
         Boolean enabled = PluginBase.MainForm.GetThemeColor("ScrollBar.ForeColor") != Color.Empty;
         if (enabled && !this.Controls.Contains(this.vScrollBar))
         {
             this.AddScrollBars(this);
         }
         else if (!enabled && this.Controls.Contains(this.vScrollBar))
         {
             this.RemoveScrollBars(this);
         }
     }
 }
开发者ID:ImaginationSydney,项目名称:flashdevelop,代码行数:18,代码来源:ScintillaControl.cs


示例6: HandleEvent

        public void HandleEvent(object sender, NotifyEvent e, HandlingPriority priority)
        {
            Project project;
            switch (e.Type)
            {
                case EventType.Command:
                    DataEvent evt = (DataEvent)e;
                    if (evt.Action == "ProjectManager.CreateNewFile")
                    {
                        Hashtable table = evt.Data as Hashtable;
                        project = PluginBase.CurrentProject as Project;
                        if ((project.Language.StartsWith("as")) && IsModuleTemplate(table["templatePath"] as String))
                        {
                            evt.Handled = true;
                            showWizard(table["inDirectory"] as string, table["templatePath"] as String);

                            //String className = table.ContainsKey("className") ? table["className"] as String : TextHelper.GetString("Wizard.Label.NewClass");
                            //DisplayClassWizard(table["inDirectory"] as String, table["templatePath"] as String, className, table["constructorArgs"] as String, table["constructorArgTypes"] as List<String>);
                        }
                    }
                    break;

                //case EventType.FileSwitch:
                //    if (PluginBase.MainForm.CurrentDocument.FileName == processOnSwitch)
                //    {
                //        processOnSwitch = null;
                //        if (lastFileOptions == null || lastFileOptions.interfaces == null) return;
                //        foreach (String cname in lastFileOptions.interfaces)
                //        {
                //            ASContext.Context.CurrentModel.Check();
                //            ClassModel inClass = ASContext.Context.CurrentModel.GetPublicClass();
                //            ASGenerator.SetJobContext(null, cname, null, null);
                //            ASGenerator.GenerateJob(GeneratorJobType.ImplementInterface, null, inClass, null, null);
                //        }
                //        lastFileOptions = null;
                //    }
                //    break;

                case EventType.ProcessArgs:
                    TextEvent te = e as TextEvent;
                    project = PluginBase.CurrentProject as Project;
                    if (lastFileFromTemplate != null && project != null && (project.Language.StartsWith("as")))
                    {
                        te.Value = ProcessArgs(project, te.Value);
                    }
                    break;
            }
        }
开发者ID:fordream,项目名称:wanghe-project,代码行数:48,代码来源:PluginMain.cs


示例7: RemoveEventHandler

 /// <summary>
 /// Removes the specified event handler
 /// </summary>
 public static void RemoveEventHandler(IEventHandler handler, EventType mask, HandlingPriority priority)
 {
     try
     {
         EventObject eo = new EventObject(handler, mask, priority);
         switch (priority)
         {
             case HandlingPriority.High:
                 highObjects.Remove(eo);
                 break;
             case HandlingPriority.Normal:
                 normalObjects.Remove(eo);
                 break;
             case HandlingPriority.Low:
                 lowObjects.Remove(eo);
                 break;
         }
     }
     catch (Exception ex)
     {
         ErrorManager.ShowError(ex);
     }
 }
开发者ID:CamWiseOwl,项目名称:flashdevelop,代码行数:26,代码来源:EventManager.cs


示例8: HandleEvent

		/// <summary>
		/// Handles the incoming events
		/// </summary>
		public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
		{
            if (e.Type == EventType.UIStarted)
            {
                try
                {
                    foreach (Macro macro in this.settingObject.UserMacros)
                    {
                        if (macro.AutoRun)
                        {
                            foreach (String entry in macro.Entries)
                            {
                                String[] parts = entry.Split(new Char[1] { '|' });
                                PluginBase.MainForm.CallCommand(parts[0], parts[1]);
                            }
                        }
                    }
                }
                catch (Exception ex) 
                {
                    ErrorManager.AddToLog("Macro AutoRun Failed.", ex);
                }
            }
            if (e.Type == EventType.ApplySettings)
            {
                this.UpdateMenuShortcut();
            }
		}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:31,代码来源:PluginMain.cs


示例9: HandleEvent

 /// <summary>
 /// Handles the incoming events
 /// </summary>
 public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
 {
     switch (e.Type)
     {
         case EventType.Command :
             this.HandleCommand(((DataEvent)e));
             break;
     }
 }
开发者ID:Dsnoi,项目名称:flashdevelopjp,代码行数:12,代码来源:PluginMain.cs


示例10: HandleEvent

 /// <summary>
 /// Handles the incoming events
 /// </summary>
 public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
 {
     ITabbedDocument document = PluginBase.MainForm.CurrentDocument;
     if (document == null || !document.IsEditable) return;
     switch (e.Type)
     {
         case EventType.Keys:
         {
             Keys keys = (e as KeyEvent).Value;
             if (this.IsSupported(document) && keys == (Keys.Control | Keys.Space))
             {
                 if (completion != null)
                 {
                     completion.OnComplete(document.SciControl, document.SciControl.CurrentPos);
                     e.Handled = true;
                 }
             }
             break;
         }
         case EventType.FileSwitch:
         case EventType.SyntaxChange:
         case EventType.ApplySettings:
         {
             if (document.IsEditable && this.IsSupported(document))
             {
                 string ext = Path.GetExtension(document.FileName).ToLower();
                 features = enabledLanguages.ContainsKey(ext) ? enabledLanguages[ext] : null;
                 if (completion == null) completion = new Completion(config, settingObject);
                 completion.OnFileChanged(features);
                 if (features != null && features.Syntax != null)
                 {
                     ScintillaControl sci = document.SciControl;
                     sci.SetProperty(features.Syntax, features != null ? "1" : "0");
                     sci.Colourise(0, -1);
                 }
             }
             break;
         }
         case EventType.Completion:
         {
             if (features != null) e.Handled = true;
             return;
         }
         case EventType.FileSave:
         {
             if (document != null && document.IsEditable && this.IsSupported(document))
             {
                 updateFile = document.FileName;
                 updateFeatures = features;
                 updater.Start();
             }
             break;
         }
     }
 }
开发者ID:CamWiseOwl,项目名称:flashdevelop,代码行数:58,代码来源:PluginMain.cs


示例11: HandleEvent

        public void HandleEvent(object sender, NotifyEvent e, HandlingPriority priority)
        {
            switch (e.Type)
            {
                case EventType.FileSwitch:
                    if (PluginBase.MainForm.CurrentDocument.IsEditable)
                    {
                        PluginBase.MainForm.CurrentDocument.SciControl.DoubleClick -= new ScintillaNet.DoubleClickHandler(SciControl_DoubleClick);
                        PluginBase.MainForm.CurrentDocument.SciControl.Modified -= new ScintillaNet.ModifiedHandler(SciControl_Modified);
                        PluginBase.MainForm.CurrentDocument.SciControl.UpdateUI -= new ScintillaNet.UpdateUIHandler(SciControl_UpdateUI);
                        PluginBase.MainForm.CurrentDocument.SciControl.DoubleClick += new ScintillaNet.DoubleClickHandler(SciControl_DoubleClick);
                        PluginBase.MainForm.CurrentDocument.SciControl.Modified += new ScintillaNet.ModifiedHandler(SciControl_Modified);
                        PluginBase.MainForm.CurrentDocument.SciControl.UpdateUI += new ScintillaNet.UpdateUIHandler(SciControl_UpdateUI);

                    }
                    break;
                case EventType.FileModify:
                    cb.Visible = false;
                    isActive = false;
                    break;
                default:
                    break;
            };
        }
开发者ID:fordream,项目名称:wanghe-project,代码行数:24,代码来源:PluginMain.cs


示例12: HandleEvent

        /**
        * Handles the incoming events
        */
        public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
        {
            try
            {
                // ignore all events when leaving
                if (PluginBase.MainForm.ClosingEntirely) return;
                // current active document
                ITabbedDocument doc = PluginBase.MainForm.CurrentDocument;

                // application start
                if (!started && e.Type == EventType.UIStarted)
                {
                    started = true;
                    PathExplorer.OnUIStarted();
                    // associate context to initial document
                    e = new NotifyEvent(EventType.SyntaxChange);
                    this.pluginUI.UpdateAfterTheme();
                }

                // editor ready?
                if (doc == null) return;
                ScintillaControl sci = doc.IsEditable ? doc.SciControl : null;

                //
                //  Events always handled
                //
                bool isValid;
                DataEvent de;
                switch (e.Type)
                {
                    // caret position in editor
                    case EventType.UIRefresh:
                        if (!doc.IsEditable) return;
                        timerPosition.Enabled = false;
                        timerPosition.Enabled = true;
                        return;

                    // key combinations
                    case EventType.Keys:
                        Keys key = (e as KeyEvent).Value;
                        if (ModelsExplorer.HasFocus)
                        {
                            e.Handled = ModelsExplorer.Instance.OnShortcut(key);
                            return;
                        }
                        if (!doc.IsEditable) return;
                        e.Handled = ASComplete.OnShortcut(key, sci);
                        return;

                    // user-customized shortcuts
                    case EventType.Shortcut:
                        de = e as DataEvent;
                        if (de.Action == "Completion.ShowHelp")
                        {
                            ASComplete.HelpKeys = (Keys)de.Data;
                            de.Handled = true;
                        }
                        return;

                    //
                    // File management
                    //
                    case EventType.FileSave:
                        if (!doc.IsEditable) return;
                        ASContext.Context.CheckModel(false);
                        // toolbar
                        isValid = ASContext.Context.IsFileValid;
                        if (isValid && !PluginBase.MainForm.SavingMultiple)
                        {
                            if (ASContext.Context.Settings.CheckSyntaxOnSave) CheckSyntax(null, null);
                            ASContext.Context.RemoveClassCompilerCache();
                        }
                        return;

                    case EventType.SyntaxDetect:
                        // detect Actionscript language version
                        if (!doc.IsEditable) return;
                        if (doc.FileName.ToLower().EndsWithOrdinal(".as"))
                        {
                            settingObject.LastASVersion = DetectActionscriptVersion(doc);
                            (e as TextEvent).Value = settingObject.LastASVersion;
                            e.Handled = true;
                        }
                        break;

                    case EventType.ApplySettings:
                    case EventType.SyntaxChange:
                    case EventType.FileSwitch:
                        if (!doc.IsEditable)
                        {
                            ASContext.SetCurrentFile(null, true);
                            ContextChanged();
                            return;
                        }
                        currentDoc = doc.FileName;
                        currentPos = sci.CurrentPos;
                        // check file
//.........这里部分代码省略.........
开发者ID:JoeRobich,项目名称:flashdevelop,代码行数:101,代码来源:PluginMain.cs


示例13: HandleEvent

        /// <summary>
        /// Handles the incoming events
        /// </summary>
        public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
        {
            switch (e.Type)
            {
                case EventType.UIStarted:
                    ProjectWatcher.Init();
                    this.ready = true;
                    break;

                // Catches Project change event and display the active project path
                case EventType.Command:
                    if (!this.ready) return;
                    DataEvent de = e as DataEvent;
                    String cmd = de.Action;
                    if (!cmd.StartsWith("ProjectManager.")) return;
                    switch (cmd)
                    {
                        case ProjectManagerEvents.Project:
                            ProjectWatcher.SetProject(de.Data as Project);
                            break;

                        case ProjectManagerEvents.TreeSelectionChanged:
                            ProjectWatcher.SelectionChanged();
                            break;

                        case ProjectManagerEvents.UserRefreshTree:
                            ProjectWatcher.ForceRefresh();
                            break;

                        case ProjectFileActionsEvents.FileBeforeRename:
                            try
                            {
                                de.Handled = ProjectWatcher.HandleFileBeforeRename(de.Data as String);
                            }
                            catch (Exception ex)
                            {
                                ErrorManager.ShowError(ex);
                                de.Handled = true;
                            }
                            break;

                        case ProjectFileActionsEvents.FileRename:
                            try
                            {
                                de.Handled = ProjectWatcher.HandleFileRename(de.Data as String[]);
                            }
                            catch (Exception ex)
                            {
                                ErrorManager.ShowError(ex);
                                de.Handled = true;
                            }
                            break;

                        case ProjectFileActionsEvents.FileDeleteSilent:
                            try
                            {
                                de.Handled = ProjectWatcher.HandleFileDelete(de.Data as String[], false);
                            }
                            catch (Exception ex)
                            {
                                ErrorManager.ShowError(ex);
                                de.Handled = true;
                            }
                            break;

                        case ProjectFileActionsEvents.FileDelete:
                            try
                            {
                                de.Handled = ProjectWatcher.HandleFileDelete(de.Data as String[], true);
                            }
                            catch (Exception ex)
                            {
                                ErrorManager.ShowError(ex);
                                de.Handled = true;
                            }
                            break;

                        case ProjectFileActionsEvents.FileMove:
                            try
                            {
                                de.Handled = ProjectWatcher.HandleFileMove(de.Data as String[]);
                            }
                            catch (Exception ex)
                            {
                                ErrorManager.ShowError(ex);
                                de.Handled = true;
                            }
                            break;

                        case ProjectManagerEvents.BuildProject:
                            try
                            {
                                de.Handled = ProjectWatcher.HandleBuildProject();
                            }
                            catch (Exception ex)
                            {
                                ErrorManager.ShowError(ex);
//.........这里部分代码省略.........
开发者ID:ImaginationSydney,项目名称:flashdevelop,代码行数:101,代码来源:PluginMain.cs


示例14: HandleEvent

		/// <summary>
		/// Handles the incoming events
		/// </summary>
		public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
		{
            switch (e.Type)
            {
                case EventType.FileSwitch:
                    this.GenerateSurroundMenuItems();
                    UpdateMenuItems();
                    break;

                case EventType.UIStarted:
                    // Expose plugin's refactor main menu & context menu...
                    EventManager.DispatchEvent(this, new DataEvent(EventType.Command, "CodeRefactor.Menu", this.refactorMainMenu));
                    EventManager.DispatchEvent(this, new DataEvent(EventType.Command, "CodeRefactor.ContextMenu", this.refactorContextMenu));
                    // Watch resolved context for menu item updating...
                    ASComplete.OnResolvedContextChanged += OnResolvedContextChanged;
                    this.UpdateMenuItems();
                    break;

                case EventType.Command:
                    DataEvent de = (DataEvent)e;
                    string[] args;
                    string oldPath;
                    string newPath;
                    switch (de.Action)
                    {
                        case ProjectFileActionsEvents.FileRename:
                            args = de.Data as string[];
                            oldPath = args[0];
                            newPath = args[1];
                            if (Directory.Exists(oldPath) && IsValidForMove(oldPath, newPath))
                            {
                                MovingHelper.AddToQueue(new Dictionary<string, string> { { oldPath, newPath } }, true, true);
                                e.Handled = true;
                            }
                            else if (IsValidForRename(oldPath, newPath))
                            {
                                RenameFile(oldPath, newPath);
                                e.Handled = true;
                            }
                            break;

                        case ProjectFileActionsEvents.FileMove:
                            args = de.Data as string[];
                            oldPath = args[0];
                            newPath = args[1];
                            if (IsValidForMove(oldPath, newPath))
                            {
                                MovingHelper.AddToQueue(new Dictionary<string, string> { { oldPath, newPath } });
                                e.Handled = true;
                            }
                            break;
                    }
                    break;
            }
		}
开发者ID:Gr33z00,项目名称:flashdevelop,代码行数:58,代码来源:PluginMain.cs


示例15: HandleEvent

        /// <summary>
        /// Handles the incoming events
        /// </summary>
        public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
        {
            switch (e.Type)
            {
                case EventType.FileSwitch:
                    this.GenerateSurroundMenuItems();
                    break;

                case EventType.UIStarted:
                    // Expose plugin's refactor main menu & context menu...
                    EventManager.DispatchEvent(this, new DataEvent(EventType.Command, "CodeRefactor.Menu", this.refactorMainMenu));
                    EventManager.DispatchEvent(this, new DataEvent(EventType.Command, "CodeRefactor.ContextMenu", this.refactorContextMenu));
                    // Watch resolved context for menu item updating...
                    ASComplete.OnResolvedContextChanged += new ResolvedContextChangeHandler(this.OnResolvedContextChanged);
                    this.UpdateMenuItems();
                    break;

                case EventType.Command:
                    DataEvent de = (DataEvent)e;
                    switch (de.Action)
                    {
                        case ProjectFileActionsEvents.FileRename:
                            string[] args = de.Data as String[];
                            string oldPath = args[0];
                            string newPath = args[1];
                            if (IsValidForRename(args[0], args[1]))
                            {
                                RenameFile(args[0], args[1]);
                                e.Handled = true;
                            }
                            break;
                    }
                    break;
            }
        }
开发者ID:thecocce,项目名称:flashdevelop,代码行数:38,代码来源:PluginMain.cs


示例16: HandleEvent

 /// <summary>
 /// Handles the internal events
 /// </summary>
 public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
 {
     if (!this.isEnabled) return;
     ITabbedDocument document;
     switch (e.Type)
     {
         case EventType.FileSwitch:
             document = PluginBase.MainForm.CurrentDocument;
             if (document.IsEditable)
             {
                 if (this.currentFileName != null && this.currentPos > -1)
                 {
                     if (this.currentFileName.ToUpper() == document.FileName.ToUpper())
                     {
                         this.MoveToPosition(document.SciControl, currentPos);
                     }
                 }
                 else RefreshCurrentFile(document.SciControl);
             }
             this.currentFileName = null;
             this.currentPos = -1;
             break;
         case EventType.FileSave:
             document = PluginBase.MainForm.CurrentDocument;
             if (document.IsEditable) RefreshCurrentFile(document.SciControl);
             break;
         case EventType.Keys:
             Keys keys = (e as KeyEvent).Value;
             if (this.ContainsFocus && keys == Keys.Escape)
             {
                 ITabbedDocument doc = PluginBase.MainForm.CurrentDocument;
                 if (doc != null && doc.IsEditable)
                 {
                     doc.SciControl.Focus();
                     e.Handled = true;
                 }
             }
             break;
     }
 }
开发者ID:JoeRobich,项目名称:flashdevelop,代码行数:43,代码来源:PluginUI.cs


示例17: HandleEvent

 /// <summary>
 /// Handles the incoming events
 /// </summary>
 public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
 {
 }
开发者ID:nomilogic,项目名称:fdplugins,代码行数:6,代码来源:PluginMain.cs


示例18: HandleEvent

 public void HandleEvent(object sender, NotifyEvent e, HandlingPriority priority)
 {
     switch (e.Type)
     {
         case EventType.FileSwitch:
             if (PluginBase.MainForm.CurrentDocument.IsEditable)
             {
                 //PluginBase.MainForm.CurrentDocument.SciControl.DoubleClick += new ScintillaNet.DoubleClickHandler(SciControl_DoubleClick);
                 PluginBase.MainForm.CurrentDocument.SciControl.Modified -= new ScintillaNet.ModifiedHandler(SciControl_Modified);
                 PluginBase.MainForm.CurrentDocument.SciControl.Modified += new ScintillaNet.ModifiedHandler(SciControl_Modified);
             }
             break;
         default:
             break;
     };
 }
开发者ID:fordream,项目名称:wanghe-project,代码行数:16,代码来源:PluginMain.cs


示例19: HandleEvent

        public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority) {
            string fileName = PluginBase.MainForm.CurrentDocument.FileName;

            switch (e.Type) {
                case EventType.FileSwitch:
                    handleActivity(fileName, false);
                    break;

                case EventType.FileSave:
                    handleActivity(fileName, true);
                    break;

            }
        }
开发者ID:CamWiseOwl,项目名称:flashdevelop-wakatime,代码行数:14,代码来源:PluginMain.cs


示例20: HandleEvent

 public void HandleEvent(object sender, NotifyEvent e, HandlingPriority priority)
 {
     switch (e.Type)
     {
         default:
             break;
     };
 }
开发者ID:fordream,项目名称:wanghe-project,代码行数:8,代码来源:PluginMain.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Handshake类代码示例发布时间:2022-05-24
下一篇:
C# Handler类代码示例发布时间: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