本文整理汇总了C#中PluginInitContext类的典型用法代码示例。如果您正苦于以下问题:C# PluginInitContext类的具体用法?C# PluginInitContext怎么用?C# PluginInitContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PluginInitContext类属于命名空间,在下文中一共展示了PluginInitContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SettingsControl
public SettingsControl(PluginInitContext context, SettingsViewModel viewModel)
{
InitializeComponent();
_context = context;
_settings = viewModel.Settings;
DataContext = viewModel;
}
示例2: ProgramSuffixes
public ProgramSuffixes(PluginInitContext context, Settings settings)
{
this.context = context;
InitializeComponent();
_settings = settings;
tbSuffixes.Text = string.Join(ProgramSource.SuffixSeperator.ToString(), _settings.ProgramSuffixes);
}
示例3: Init
public void Init(PluginInitContext context)
{
var dir = new DirectoryInfo(@"Plugins\Wox.Plugin.ServerCodes\Codes"); // папка с файлами
// получаем полный путь к файлу и потом вычищаем ненужное, оставляем только имя файла.
_files = dir.GetFiles("*.txt").Select(file => Path.GetFileNameWithoutExtension(file.FullName)).ToList();
}
示例4: Init
public void Init(PluginInitContext context)
{
this.context = context;
controlPanelItems = ControlPanelList.Create(48);
iconFolder = Path.Combine(context.CurrentPluginMetadata.PluginDirectory, @"Images\ControlPanelIcons\");
fileType = ".bmp";
if (!Directory.Exists(iconFolder))
{
Directory.CreateDirectory(iconFolder);
}
foreach (ControlPanelItem item in controlPanelItems)
{
if (!File.Exists(iconFolder + item.GUID + fileType) && item.Icon != null)
{
item.Icon.ToBitmap().Save(iconFolder + item.GUID + fileType);
}
}
Task.Run(() =>
{
var characters = controlPanelItems.Select(i => i.LocalizedString)
.Concat(controlPanelItems.Select(i => i.InfoTip));
Parallel.ForEach(characters, c =>
{
if (!string.IsNullOrWhiteSpace(c) && Alphabet.ContainsChinese(c))
{
Alphabet.PinyinComination(c);
}
});
});
}
示例5: InitInternal
protected override void InitInternal(PluginInitContext context)
{
this.context = context;
if (UserSettingStorage.Instance.WebSearches == null)
UserSettingStorage.Instance.WebSearches = UserSettingStorage.Instance.LoadDefaultWebSearches();
}
示例6: ProgramSuffixes
public ProgramSuffixes(PluginInitContext context)
{
this.context = context;
InitializeComponent();
tbSuffixes.Text = ProgramStorage.Instance.ProgramSuffixes;
}
示例7: Init
public void Init(PluginInitContext context)
{
this.Context = context;
if (WebSearchStorage.Instance.WebSearches == null)
WebSearchStorage.Instance.WebSearches = WebSearchStorage.Instance.LoadDefaultWebSearches();
}
示例8: ProgramSetting
public ProgramSetting(PluginInitContext context, Settings settings)
{
this.context = context;
InitializeComponent();
Loaded += Setting_Loaded;
_settings = settings;
}
示例9: InitInternal
protected override void InitInternal(PluginInitContext context)
{
availableResults.Add(new Result
{
Title = "Shutdown",
SubTitle = "Shutdown Computer",
Score = 100,
IcoPath = "Images\\exit.png",
Action = (c) => Process.Start("shutdown","/s /t 0")
});
availableResults.Add(new Result
{
Title = "Log off",
SubTitle = "Log off current user",
Score = 20,
IcoPath = "Images\\logoff.png",
Action = (c) => ExitWindowsEx(EWX_LOGOFF, 0)
});
availableResults.Add(new Result
{
Title = "Lock",
SubTitle = "Lock this computer",
Score = 20,
IcoPath = "Images\\lock.png",
Action = (c) => LockWorkStation()
});
availableResults.Add(new Result
{
Title = "Exit",
SubTitle = "Close this app",
Score = 110,
IcoPath = "Images\\app.png",
Action = (c) => context.CloseApp()
});
}
示例10: WebSearchesSetting
public WebSearchesSetting(PluginInitContext context)
{
this.context = context;
InitializeComponent();
Loaded += Setting_Loaded;
}
示例11: Init
public void Init( PluginInitContext context )
{
if ( !SimpleIoc.Default.IsRegistered<IMessageService>() )
{
SimpleIoc.Default.Register<IMessageService>( () => new MessageService() );
}
initContext = context;
}
示例12: JrnlService
public JrnlService(SettingElements settings, PluginInitContext context)
{
if (settings == null)
throw new ArgumentNullException("settings", "settings is null.");
if (context == null)
throw new ArgumentNullException("context", "context is null.");
_settings = settings;
}
示例13: Init
public void Init( PluginInitContext context )
{
if ( !SimpleIoc.Default.IsRegistered<IMessageService>() )
{
SimpleIoc.Default.Register<IMessageService>( () => new MessageService() );
}
initContext = context;
commands = RunnerConfiguration.GetCommands();
}
示例14: Init
public void Init(PluginInitContext context)
{
this.context = context;
PluginDirectory = context.CurrentPluginMetadata.PluginDirectory;
weibo = new Weibo();
keepLoginTimer = new System.Threading.Timer(new TimerCallback(this.KeepLoginCallBack), null, Timeout.Infinite, Timeout.Infinite);
}
示例15: InitInternal
protected override void InitInternal(PluginInitContext context)
{
this.context = context;
if (UserSettingStorage.Instance.FolderLinks == null) {
UserSettingStorage.Instance.FolderLinks = new List<FolderLink>();
UserSettingStorage.Instance.Save();
}
}