Esempio n. 1
0
        public MainForm(bool remoted)
        {
            InitializeComponent();

            this.remoted = remoted;
            if (!remoted)
            {
                if (IntPtr.Size == 4)
                {
                    Text += " - " + Resources.X86;
                }
                else
                {
                    Text += " - " + Resources.Amd64;

                    if (!Program.NoWow)
                    {
                        string channel = string.Format(CultureInfo.InvariantCulture, "{0:N}{1:X}", Guid.NewGuid(), Handle);
                        int    id;
                        using (Process p = Process.GetCurrentProcess())
                        {
                            id = p.Id;
                        }

                        using (Process p = Process.Start("WicCop.32BitsLoader.exe", string.Format(CultureInfo.InvariantCulture, "{0} {1}", channel, id)))
                        {
                            remote = (Remote)Activator.GetObject(typeof(MarshalByRefObject), string.Format(CultureInfo.InvariantCulture, "ipc://{0}/{1}", channel, Remote.ObjectName));
                            for (int i = 0; i < 7; i++)
                            {
                                try
                                {
                                    remote.SetFiles(Settings.Default.Files);
                                    break;
                                }
                                catch (RemotingException)
                                {
                                    Thread.Sleep(1000);
                                }
                            }
                        }
                    }
                }
            }

            rulesTreeView.Nodes.Add(new AllComponentsRuleGroup(Resources.Decoders_Text, WICComponentType.WICDecoder, AddDecoderRules, remote));
            rulesTreeView.Nodes.Add(new AllComponentsRuleGroup(Resources.Encoders_Text, WICComponentType.WICEncoder, AddEncoderRules, remote));
            rulesTreeView.Nodes.Add(new AllComponentsRuleGroup(Resources.PixelFormats_Text, WICComponentType.WICPixelFormat, AddPixelFormatRules, remote));
            rulesTreeView.Nodes.Add(new AllComponentsRuleGroup(Resources.PixelFormatConverters_Text, WICComponentType.WICPixelFormatConverter, AddFormatConverterRules, remote));

            shellIntegrationRuleGroup = new ShellIntegrationRuleGroup(remote);
            rulesTreeView.Nodes.Add(shellIntegrationRuleGroup);

            rulesTreeView.Sort();
        }
Esempio n. 2
0
 public Dictionary <string, KeyValuePair <HashSet <string>, HashSet <Guid> > > GetExtensions()
 {
     return(ShellIntegrationRuleGroup.GetExtensions(null));
 }