private string FindAscAuthoring() { string flashPath = ASContext.CommonSettings.PathToFlashIDE; if (flashPath == null) { return(null); } string configPath = PluginMain.FindAuthoringConfigurationPath(flashPath); if (configPath == null) { return(null); } string ascJar = Path.Combine(configPath, "ActionScript 3.0\\asc_authoring.jar"); if (File.Exists(ascJar)) { return(ascJar); } else { return(null); } }
/// <summary> /// Get activities from current view /// </summary> /// <param name="all">Get All activities if True, or just selected activities if False. /// NOTE: This only applies to Reports View.</param> /// <returns>Activities from this page's associated view (defined in constructor)</returns> internal IEnumerable <IActivity> GetActivities(bool all) { IList <IActivity> activities = new List <IActivity>(); // Prevent null ref error during startup if (PluginMain.GetApplication().Logbook == null || PluginMain.GetApplication().ActiveView == null) { return(activities); } IView view = PluginMain.GetApplication().ActiveView; if (view != null && IsDailyActivityView) { IDailyActivityView activityView = view as IDailyActivityView; activities = CollectionUtils.GetAllContainedItemsOfType <IActivity>(activityView.SelectionProvider.SelectedItems); } else if (view != null && IsReportView) { IActivityReportsView reportsView = view as IActivityReportsView; if (all) { activities = reportsView.ActiveReport.Activities; } else { activities = CollectionUtils.GetAllContainedItemsOfType <IActivity>(reportsView.SelectionProvider.SelectedItems); } } return(activities); }
private void SaveImageButton_Click(object sender, EventArgs e) { ITheme theme = PluginMain.GetApplication().VisualTheme; SaveImageDialog save = new SaveImageDialog(); save.ThemeChanged(theme); save.CanChangeImageSize = false; save.FileName = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), Resources.Strings.Label_QuadrantAnalysis + " " + DateTime.Now.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture)); if (save.ShowDialog() == DialogResult.OK) { // Image Saved (save occurs in SaveDialog) string filename = save.FileName; if (System.IO.File.Exists(filename)) { if (MessageDialog.Show("File exists. Overwrite?", "File Save", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } } zedChart.GetImage().Save(save.FileName, save.ImageFormat); } save.Dispose(); }
/// <summary> /// Gets the current program /// </summary> /// <returns></returns> private VideoInfo GetCurrentProgram() { VideoInfo videoInfo = new VideoInfo(); // get current program details GuideProgram program = PluginMain.GetProgramAt(DateTime.Now); if (program == null || string.IsNullOrEmpty(program.Title)) { TraktLogger.Info("Unable to get current program from database."); return(null); } else { string title = null; string year = null; GetTitleAndYear(program, out title, out year); videoInfo = new VideoInfo { Type = program.EpisodeNumber != null || program.SeriesNumber != null ? VideoType.Series : VideoType.Movie, Title = title, Year = year, SeasonIdx = program.SeriesNumber == null ? null : program.SeriesNumber.ToString(), EpisodeIdx = program.EpisodeNumber == null ? null : program.EpisodeNumber.ToString(), StartTime = program.StartTime, Runtime = GetRuntime(program) }; } return(videoInfo); }
private void btnDirTree_Click(object sender, EventArgs e) { this.dirTree = new DirectoryTreePopup(); this.dirTree.ThemeChanged(PluginMain.GetApplication().VisualTheme); // Display a DirectoryTreePopup if (Directory.Exists(txtDirectory.Text)) { this.dirTree.Tree.SelectedPath = txtDirectory.Text; } // Define size and location this.dirTree.Location = txtDirectory.Location; // Show the directory tree Rectangle rect = new Rectangle(txtDirectory.Location, txtDirectory.Size); rect.Offset(this.Location); rect.Offset(4, txtDirectory.Height + 4); // Add event handlers for selecting folder this.dirTree.ItemSelected += new DirectoryTreePopup.ItemSelectedEventHandler(dirTree_ItemSelected); this.dirTree.Popup(rect); }
private void menuTreeItem_Click(object sender, EventArgs e) { ListSettingsDialog listDialog = new ListSettingsDialog(); ICollection <IListColumnDefinition> available = new List <IListColumnDefinition>(); available.Add(new ColumnDefinition(ColumnDefinition.Q1Percent)); available.Add(new ColumnDefinition(ColumnDefinition.Q2Percent)); available.Add(new ColumnDefinition(ColumnDefinition.Q2PercentHigh)); available.Add(new ColumnDefinition(ColumnDefinition.Q2PercentLow)); available.Add(new ColumnDefinition(ColumnDefinition.Q3Percent)); available.Add(new ColumnDefinition(ColumnDefinition.Q4Percent)); available.Add(new ColumnDefinition(ColumnDefinition.Q4PercentHigh)); available.Add(new ColumnDefinition(ColumnDefinition.Q4PercentLow)); available.Add(new ColumnDefinition(ColumnDefinition.Q1Time)); available.Add(new ColumnDefinition(ColumnDefinition.Q2Time)); available.Add(new ColumnDefinition(ColumnDefinition.Q2TimeHigh)); available.Add(new ColumnDefinition(ColumnDefinition.Q2TimeLow)); available.Add(new ColumnDefinition(ColumnDefinition.Q3Time)); available.Add(new ColumnDefinition(ColumnDefinition.Q4Time)); available.Add(new ColumnDefinition(ColumnDefinition.Q4TimeHigh)); available.Add(new ColumnDefinition(ColumnDefinition.Q4TimeLow)); listDialog.AvailableColumns = available; List <string> selected = new List <string>(); foreach (string id in GlobalSettings.Instance.TreeColumns) { ColumnDefinition value = new ColumnDefinition(id); if (available.Contains(value) && !selected.Contains(id)) { selected.Add(id); } } listDialog.SelectedColumns = selected; listDialog.Text = CommonResources.Text.LabelCharts; listDialog.SelectedItemListLabel = Resources.Strings.Label_SelectedCharts; listDialog.AddButtonLabel = CommonResources.Text.ActionAdd; listDialog.AllowFixedColumnSelect = false; listDialog.AllowZeroSelected = true; listDialog.Icon = Util.Utilities.GetIcon(Resources.Images.Charts); listDialog.ThemeChanged(PluginMain.GetApplication().VisualTheme); if (listDialog.ShowDialog() == DialogResult.OK) { GlobalSettings.Instance.TreeColumns = listDialog.SelectedColumns as List <string>; InitializeTreelist(maximized); RefreshPage(); } listDialog.Close(); listDialog.Dispose(); return; }
/// <summary> /// Private helper to dig the logbook for a custom parameter /// </summary> /// <param name="dataType"></param> /// <param name="id"></param> /// <returns></returns> private static ICustomDataFieldDefinition GetCustomProperty(ICustomDataFieldDataType dataType, ICustomDataFieldObjectType objType, Guid id, string name) { // Dig all of the existing custom params looking for a match. foreach (ICustomDataFieldDefinition customDef in PluginMain.GetLogbook().CustomDataFieldDefinitions) { if (customDef.Id == id) { // Is this really necessary...? if (customDef.DataType != dataType) { // Invalid match found!!! Bad news. // This might occur if a user re-purposes a field. if (!warningMsgBadField) { warningMsgBadField = true; MessageDialog.Show("Invalid " + name + " Custom Field. Was this field data type modified? (" + customDef.Name + ")", Resources.Strings.Label_QuadrantAnalysis); } return(null); } else { // Return custom def return(customDef); } } } // No match found, create it return(PluginMain.GetLogbook().CustomDataFieldDefinitions.Add(id, objType, dataType, name)); }
public CreateClassfrm(CreateClassFrmSettings setting, PluginMain plugin) { InitWithSettings(setting); Project project = (Project)PluginBase.CurrentProject; if (project == null) { asc = new GenerateClass(); SetLanguage("as3"); return; } SetLanguage(project.Language.ToLower() ); ScintillaNet.ScintillaControl sci = ASCompletion.Context.ASContext.CurSciControl; if (sci != null) { txtFilePath.Text = Path.GetDirectoryName(sci.FileName); } if (txtFilePath.Text.Length==0 ) { txtFilePath.Text = project.AbsoluteClasspaths[0]; } asc = new GenerateClass(); txtNameClass.TabIndex = 0; }
public ScriptEditView(PluginMain main) { InitializeComponent(); InitializeMargins(); InitializeAutoComplete(); Icon = Icon.FromHandle(Resources.ScriptIcon.GetHicon()); _main = main; _quickFind = new QuickFind(this, _codeBox); _codeBox.Dock = DockStyle.Fill; _codeBox.Styles[Style.Default].Font = "Consolas"; _codeBox.Styles[Style.Default].SizeF = 10.25F; _codeBox.CharAdded += codeBox_CharAdded; _codeBox.InsertCheck += codeBox_InsertCheck; _codeBox.KeyDown += codebox_KeyDown; _codeBox.MarginClick += codeBox_MarginClick; _codeBox.SavePointLeft += codeBox_SavePointLeft; _codeBox.SavePointReached += codeBox_SavePointReached; _codeBox.TextChanged += codeBox_TextChanged; _codeBox.UpdateUI += codeBox_UpdateUI; Controls.Add(_codeBox); Restyle(); }
public ControlPanel(PluginMain pluginMain, PluginConfig config) { InitializeComponent(); this.pluginMain = pluginMain; this.config = config; this.checkBoxAutoHide.Checked = this.config.HideOverlaysWhenNotActive; this.menuFollowLatestLog.Checked = this.config.FollowLatestLog; this.listViewLog.VirtualListSize = pluginMain.Logger.Logs.Count; this.pluginMain.Logger.Logs.ListChanged += (o, e) => { this.listViewLog.BeginUpdate(); this.listViewLog.VirtualListSize = pluginMain.Logger.Logs.Count; if (this.config.FollowLatestLog && this.listViewLog.VirtualListSize > 0) { this.listViewLog.EnsureVisible(this.listViewLog.VirtualListSize - 1); } this.listViewLog.EndUpdate(); }; InitializeOverlayConfigTabs(); UpdateOverlayListView(); }
public PopupProgress() { InitializeComponent(); status.Text = string.Empty; progress.Percent = 0f; ThemeChanged(PluginMain.GetApplication().VisualTheme); }
public static string CreateMain() { //解析Assembly //Assembly ass = Assembly.GetExecutingAssembly(); //var plugin = ass.GetCustomAttribute<XQPluginAttribute>(); //PluginInitializer.Init(ass); //这边会进行 //对插件信息的处理并返回JSON var info = PluginMain.Info(); _Main.MainXQAPI.SetAppInfo(PluginMain.Info()); _Main.MainXQAPI.AppDirectory = Directory.GetCurrentDirectory() + "\\Config" + "\\" + info.name + "\\"; if (!Directory.Exists(_Main.MainXQAPI.AppDirectory)) { Directory.CreateDirectory(_Main.MainXQAPI.AppDirectory); } PluginMain.RegEvent(); return(info.ToJson()); }
public void ShowPage(string bookmark) { visible = true; PluginMain.GetApplication().ActiveView.PropertyChanged += new PropertyChangedEventHandler(ActiveView_PropertyChanged); View.ActiveReport.PropertyChanged += new PropertyChangedEventHandler(ActiveView_PropertyChanged); control.RefreshPage(); }
public SettingsPopup() { elevationPercent = GlobalSettings.Instance.ElevationPercent; distancePercent = GlobalSettings.Instance.DistancePercent; gainElevationRequired = Length.Convert(GlobalSettings.Instance.GainElevationRequired, Length.Units.Meter, PluginMain.GetApplication().SystemPreferences.ElevationUnits); hillDistanceRequired = Length.Convert(GlobalSettings.Instance.HillDistanceRequired, Length.Units.Meter, PluginMain.GetApplication().SystemPreferences.DistanceUnits); maxDescentElevation = Length.Convert(GlobalSettings.Instance.MaxDescentElevation, Length.Units.Meter, PluginMain.GetApplication().SystemPreferences.ElevationUnits); maxDescentLength = Length.Convert(GlobalSettings.Instance.MaxDescentLength, Length.Units.Meter, PluginMain.GetApplication().SystemPreferences.DistanceUnits); minAvgGrade = GlobalSettings.Instance.MinAvgGrade; InitializeComponent(); this.Icon = Utilities.MakeIcon(Resources.Images.gear, 16, true); ThemeChanged(PluginMain.GetApplication().VisualTheme); UICultureChanged(PluginMain.GetApplication().SystemPreferences.UICulture); textBox_distancePercent.Text = distancePercent.ToString("0.00", CultureInfo.CurrentCulture); textBox_elevationPercent.Text = elevationPercent.ToString("0.00", CultureInfo.CurrentCulture); textbox_gainElevationRequired.Text = gainElevationRequired.ToString("0", CultureInfo.CurrentCulture); textbox_hillDistanceRequired.Text = hillDistanceRequired.ToString("0.0#", CultureInfo.CurrentCulture); textBox_maxDescentElevation.Text = maxDescentElevation.ToString("0", CultureInfo.CurrentCulture); textBox_maxDescentLength.Text = maxDescentLength.ToString("0.0#", CultureInfo.CurrentCulture); textBox_minAvgGrade.Text = minAvgGrade.ToString("0.00", CultureInfo.CurrentCulture); }
/// <summary> /// Gets the current program /// </summary> private VideoInfo GetCurrentProgram() { VideoInfo videoInfo = new VideoInfo(); // get current program details GuideProgram program = PluginMain.GetProgramAt(DateTime.Now); if (program == null || string.IsNullOrEmpty(program.Title)) { TraktLogger.Info("Unable to get current program from database"); return(null); } else { string title = null; string year = null; BasicHandler.GetTitleAndYear(program.Title, out title, out year); videoInfo = new VideoInfo { Type = program.EpisodeNumber != null || program.SeriesNumber != null ? VideoType.Series : VideoType.Movie, Title = title, Year = year, SeasonIdx = program.SeriesNumber == null ? null : program.SeriesNumber.ToString(), EpisodeIdx = program.EpisodeNumber == null ? null : program.EpisodeNumber.ToString(), StartTime = program.StartTime, Runtime = GetRuntime(program) }; TraktLogger.Info("Current program details. Title='{0}', Year='{1}', Season='{2}', Episode='{3}', StartTime='{4}', Runtime='{5}'", videoInfo.Title, videoInfo.Year.ToLogString(), videoInfo.SeasonIdx.ToLogString(), videoInfo.EpisodeIdx.ToLogString(), videoInfo.StartTime == null ? "<empty>" : videoInfo.StartTime.ToString(), videoInfo.Runtime); } return(videoInfo); }
/// <summary> /// 直接调用发送弹幕。 /// </summary> /// <param name="text"></param> private void SendDanmu(string text) { Task.Run(async() => { try { string result = await SendDanmaku.SendDanmakuAsync(PluginMain.RoomId.Value, text, LoginCenter.API.LoginCenterAPI.getCookies()); if (result == null) { PluginMain.Log("发送弹幕时网络错误"); } else { var j = JObject.Parse(result); if (j["msg"].ToString() != string.Empty) { PluginMain.Log("发送弹幕时服务器返回:" + j["msg"].ToString()); } } } catch (Exception ex) { if (ex.GetType().FullName.Equals("LoginCenter.API.PluginNotAuthorizedException")) { IsLogRedirectDanmaku = false; } else { PluginMain.Log("弹幕发送错误 " + ex.ToString()); } } }); }
private void AddEquipmentToCombobox(string selectedId) { EquipmentComboBox.Items.Clear(); int selectedIndex = 0; m_SetupEquipmentIds = Common.Data.GetEquipmentIds(); foreach (string currentId in m_SetupEquipmentIds) { foreach (IEquipmentItem currentEquipment in PluginMain.GetApplication().Logbook.Equipment) { if (currentEquipment.ReferenceId == currentId) { EquipmentComboBox.Items.Add(currentEquipment.Name); if (selectedId == currentId) { selectedIndex = EquipmentComboBox.Items.Count - 1; } break; } } } if (EquipmentComboBox.Items.Count > 0) { EquipmentComboBox.SelectedIndex = selectedIndex; } }
public CreateClassCmdAS3(String className, PluginMain plugin, Bitmap icon) { _className = className; _plugin = plugin; this.icon = icon; }
/// <summary> /// Called when exiting view. /// </summary> /// <returns></returns> public bool HidePage() { // Save any changes on settings exit PluginMain.GetApplication().PropertyChanged -= SportTracksApplication_PropertyChanged; pageLoaded = false; return(true); }
private void Initialize(TabPage pluginScreenSpace, Label pluginStatusText) { logger = new Logger(); asmResolver.ExceptionOccured += (o, e) => logger.Log(LogLevel.Error, "AssemblyResolver: Error: {0}", e.Exception); asmResolver.AssemblyLoaded += (o, e) => logger.Log(LogLevel.Debug, "AssemblyResolver: Loaded: {0}", e.LoadedAssembly.FullName); pluginMain = new PluginMain(pluginDirectory, logger); pluginMain.InitPlugin(pluginScreenSpace, pluginStatusText); }
public OpenResourceForm(PluginMain plugin) { this.plugin = plugin; this.InitializeComponent(); this.InitializeLocalization(); this.Font = PluginBase.Settings.DefaultFont; this.FormGuid = "8e4e0a95-0aff-422c-b8f5-ad9bc8affabb"; }
public void Log(string text) { PluginMain.Log(text); if (IsLogRedirectDanmaku) { SendMessage(text); } }
private void ExtraChartsButton_Click(object sender, EventArgs e) { ListSettingsDialog listDialog = new ListSettingsDialog(); ICollection <IListColumnDefinition> available = new List <IListColumnDefinition>(); List <string> selected = new List <string>(); // Define available and selected items foreach (CriticalLineDefinition line in GlobalSettings.Instance.CriticalPowerLines) { available.Add(new ColumnDefinition(line.Name, 100)); if (line.Selected) { selected.Add(line.Name); } } // Setup list selection dialog listDialog.AvailableColumns = available; listDialog.SelectedColumns = selected; listDialog.Text = CommonResources.Text.LabelCharts; listDialog.SelectedItemListLabel = Resources.Strings.Label_SelectedCharts; listDialog.AddButtonLabel = CommonResources.Text.ActionAdd; listDialog.AllowFixedColumnSelect = false; listDialog.AllowZeroSelected = false; listDialog.Icon = Utilities.GetIcon(Images.Charts); listDialog.ThemeChanged(PluginMain.GetApplication().VisualTheme); // Popup list dialog if (listDialog.ShowDialog() == DialogResult.OK) { selected = listDialog.SelectedColumns as List <string>; // Save selected lines int countSelected = 0; foreach (CriticalLineDefinition line in GlobalSettings.Instance.CriticalPowerLines) { // NOTE: Eval limitation: Number of charts if (selected.Contains(line.Name)) { countSelected++; line.Selected = true; } else { line.Selected = false; } } RefreshPage(); } listDialog.Close(); listDialog.Dispose(); return; }
public ActivityDataChangedHelper(IActivity activity) { Activity = activity; m_CurrentLogbook = PluginMain.GetApplication().Logbook; PluginMain.GetApplication().SystemPreferences.PropertyChanged += new PropertyChangedEventHandler(OnSystemPreferencesPropertyChanged); PluginMain.GetApplication().PropertyChanged += new PropertyChangedEventHandler(AppPropertyChanged); GearChart.Common.Data.BikeSetupChanged += new GearChart.Common.Data.BikeSetupChangedEventHandler(OnGearChartBikeSetupChanged); RegisterCategoryCallback(PluginMain.GetApplication().Logbook); }
internal static void Initialize(PluginMain pluginMain, PluginUI pluginUI) { main = pluginMain; mainUI = pluginUI; pluginUIs = new List <PluginUI>(); ActiveUI = mainUI; mainUI.ParentPanel.Tag = mainUI; mainUI.ParentPanel.IsActivatedChanged += ParentPanel_IsActivatedChanged; }
public SsjDebugger(PluginMain main, string gamePath, string enginePath, Process engine, IProject project) { plugin = main; sgmPath = gamePath; sourcePath = project.RootPath; engineProcess = engine; engineDir = Path.GetDirectoryName(enginePath); focusTimer = new Timer(HandleFocusSwitch, this, Timeout.Infinite, Timeout.Infinite); updateTimer = new Timer(UpdateDebugViews, this, Timeout.Infinite, Timeout.Infinite); }
private void AppPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e != null && e.PropertyName == "Logbook") { UnregisterCategoryCallback(m_CurrentLogbook); m_CurrentLogbook = PluginMain.GetApplication().Logbook; RegisterCategoryCallback(m_CurrentLogbook); } }
public SsjDebugger(PluginMain main, string gamePath, string enginePath, Process engine, IProject project) { m_plugin = main; m_gamePath = gamePath; m_sourcePath = project.RootPath; m_scriptPath = Path.GetDirectoryName(Path.Combine(m_sourcePath, project.MainScript)); m_engineProcess = engine; m_enginePath = Path.GetDirectoryName(enginePath); m_focusTimer = new Timer(HandleFocusSwitch, this, Timeout.Infinite, Timeout.Infinite); m_updateTimer = new Timer(UpdateDebugViews, this, Timeout.Infinite, Timeout.Infinite); }
public SkillView(PluginMain _plugin) { InitializeComponent(); this.plugin = _plugin; MoveByDrag = true; this.Move += SkillView_Move; this.MouseDown += SkillView_MouseDown; listView1.MouseDown += SkillView_MouseDown; }
/// <summary> /// Refresh the SportTracks Calendar with the selected activities /// </summary> /// <param name="activities">These activity dates will be highlighted on the calendar</param> public static void RefreshCalendar(IList <IActivity> activities) { IList <DateTime> dates = new List <DateTime>(); foreach (IActivity activity in activities) { dates.Add(activity.StartTime.ToLocalTime().Date); } PluginMain.GetApplication().Calendar.SetHighlightedDates(dates); }
public BuildActions(IMainForm mainForm, PluginMain pluginMain) { this.mainForm = mainForm; this.pluginMain = pluginMain; // setup FDProcess helper class this.fdProcess = new FDProcessRunner(mainForm); // setup remoting service so FDBuild can use our in-memory services like FlexCompilerShell this.ipcName = Guid.NewGuid().ToString(); SetupRemotingServer(); }
public void TestNew() { PluginMain plugin = new PluginMain(); Assert.AreEqual(1, plugin.Api); Assert.AreEqual("QuickNavigate", plugin.Name); Assert.AreEqual("5e256956-8f0d-4f2b-9548-08673c0adefd", plugin.Guid); Assert.AreEqual("Canab, SlavaRa", plugin.Author); Assert.AreEqual("QuickNavigate plugin", plugin.Description); Assert.AreEqual("http://www.flashdevelop.org/community/", plugin.Help); Assert.IsNull(plugin.Settings); }
public static string GetDistanceLabel(IActivity activity) { Length.Units du; if (activity != null) { du = activity.Category.DistanceUnits; } else { du = PluginMain.GetApplication().SystemPreferences.DistanceUnits; } return(Length.LabelAbbr(du)); }
public static float GetElevation(double value, IActivity activity) { Length.Units du; if (activity != null) { du = activity.Category.ElevationUnits; } else { du = PluginMain.GetApplication().SystemPreferences.ElevationUnits; } return(GetLength(value, du)); }
public void TestNew() { var plugin = new PluginMain(); Assert.AreEqual(1, plugin.Api); Assert.AreEqual("AntPanel", plugin.Name); Assert.AreEqual("92d9a647-6cd3-4347-9db6-95f324292399", plugin.Guid); Assert.AreEqual("Canab, SlavaRa", plugin.Author); Assert.AreEqual("AntPanel Plugin For FlashDevelop", plugin.Description); Assert.AreEqual("http://www.flashdevelop.org/community/", plugin.Help); Assert.AreEqual(0, plugin.BuildFilesList.Count); Assert.AreEqual("antPanelData.txt", plugin.StorageFileName); }
public NewOverlayDialog(PluginMain pluginMain) { InitializeComponent(); this.pluginMain = pluginMain; // Default validator this.NameValidator = (name) => { return name != null; }; foreach (var addon in pluginMain.Addons) { comboBox1.Items.Add(addon); } //comboBox1.ValueMember = "OverlayType"; comboBox1.DisplayMember = "Name"; comboBox1.SelectedIndex = 0; }
public CreateClassfrm(string className,Boolean isSCiContext, CreateClassFrmSettings setting, string language, PluginMain plugin) { _isSCiContext = isSCiContext; InitWithSettings(setting); txtNameClass.Text = className; txtNameClass.Enabled = false; btnCreateClass.TabIndex = 0; chkClose.Visible = false; btnSaveSetting.Visible = true; // Set current path string path = Path.GetDirectoryName(ASCompletion.Context.ASContext.CurSciControl.FileName); //MessageBox.Show(path); txtFilePath.Text = path; asc = new GenerateClass(); SetLanguage(language); }
/// <summary> /// Init completion engine context /// </summary> /// <param name="mainForm">Reference to MainForm</param> static internal void GlobalInit(PluginMain pluginMain) { dirSeparatorChar = Path.DirectorySeparatorChar; dirSeparator = dirSeparatorChar.ToString(); dirAltSeparatorChar = Path.AltDirectorySeparatorChar; dirAltSeparator = dirAltSeparatorChar.ToString(); doPathNormalization = (dirSeparator != dirAltSeparator); // language contexts plugin = pluginMain; validContexts = new List<IASContext>(); context = null; try { context = defaultContext = new ASContext(); } catch(Exception ex) { ErrorManager.ShowError(ex); } }
/// <summary> /// Creates a NoteForm for the given Note instance. We load our settings /// from the given Note instance, and we bind ourselves to the instance, /// so as the user changes this NoteForm, we serialize the changes in the /// given Note. If fadeIn is true, we fade the note in rather than just /// showing it. /// </summary> public NoteForm(PluginMain mainForm, Note note, bool fadeIn) { mainForm_ = mainForm; note_ = note; fadeIn_ = fadeIn; InitializeComponent(); this.Icon = Stickies.Icons.Media.StickiesIcon; this.preferencesMenuItem.Text = LocaleHelper.GetString("Messages.NotePreferences"); deleteMenuItem_.Text = LocaleHelper.GetString("Messages.NoteDelete"); archiveMenuItem_.Text = LocaleHelper.GetString("Messages.NoteArchive"); boldMenuItem_.Text = LocaleHelper.GetString("Messages.NoteBold"); italicMenuItem_.Text = LocaleHelper.GetString("Messages.NoteItalic"); strikethroughMenuItem_.Text = LocaleHelper.GetString("Messages.NoteStrikethrough"); // Load the settings from the Note instance this.StartPosition = FormStartPosition.Manual; this.Location = new Point(note.Left, note.Top); this.Size = new Size(note.Width, note.Height); this.BackColor = Color.FromArgb(note.BorderColor); textBox_.BackColor = Color.FromArgb(note.BackColor); textBoxPaddingPanel_.BackColor = textBox_.BackColor; textBox_.ForeColor = Color.FromArgb(note.FontColor); textBox_.Rtf = note.Rtf; this.TopMost = note.AlwaysOnTop; this.Opacity = 1.0 - note_.Transparency; // Lock this note initially since it is not a new note Lock(); UpdateTitle(); // We are not dirty since the note just loaded dirty_ = false; }