コード例 #1
0
        void Initialize()
        {
            // initialize variables
            totalItemsCreatedCount = 0;
            contentLayout          = GoogleDesktopDisplayContentItemLayout.GDD_CONTENT_ITEM_LAYOUT_EMAIL;
            totalItemsCreatedCount = 0;
            showImages             = true;
            isDirty = false;

            // Load our icons
            contentIcon1 = ImageConverter.ImageToIpicture(new Icon(
                                                              Assembly.GetExecutingAssembly().GetManifestResourceStream(
                                                                  "GoogleDesktopDisplayCSharpSample.ico1.ico")).ToBitmap());
            contentIcon2 = ImageConverter.ImageToIpicture(new Icon(
                                                              Assembly.GetExecutingAssembly().GetManifestResourceStream(
                                                                  "GoogleDesktopDisplayCSharpSample.ico2.ico")).ToBitmap());

            Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(
                "GoogleDesktopDisplayCSharpSample.plugin.ico");
            Bitmap smallImage = new Icon(stream, 16, 16).ToBitmap();

            stream.Seek(0, System.IO.SeekOrigin.Begin);
            Bitmap largeImage = new Icon(stream, 32, 32).ToBitmap();

            // Set plugin information
            IGoogleDesktopDisplayPluginHelper helper = (IGoogleDesktopDisplayPluginHelper)this;

            helper.about_text = aboutStr;
            helper.SetIcons(ImageConverter.ImageToIpicture(smallImage),
                            ImageConverter.ImageToIpicture(largeImage));
            UpdateTitle();
        }
コード例 #2
0
        void Initialize()
        {
            // initialize variables
              totalItemsCreatedCount = 0;
              contentLayout = GoogleDesktopDisplayContentItemLayout.GDD_CONTENT_ITEM_LAYOUT_EMAIL;
              totalItemsCreatedCount = 0;
              showImages = true;
              isDirty = false;

              // Load our icons
              contentIcon1 = ImageConverter.ImageToIpicture(new Icon(
            Assembly.GetExecutingAssembly().GetManifestResourceStream(
            "GoogleDesktopDisplayCSharpSample.ico1.ico")).ToBitmap());
              contentIcon2 = ImageConverter.ImageToIpicture(new Icon(
            Assembly.GetExecutingAssembly().GetManifestResourceStream(
            "GoogleDesktopDisplayCSharpSample.ico2.ico")).ToBitmap());

              Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(
            "GoogleDesktopDisplayCSharpSample.plugin.ico");
              Bitmap smallImage = new Icon(stream, 16, 16).ToBitmap();
              stream.Seek(0, System.IO.SeekOrigin.Begin);
              Bitmap largeImage = new Icon(stream, 32, 32).ToBitmap();

              // Set plugin information
              IGoogleDesktopDisplayPluginHelper helper =  (IGoogleDesktopDisplayPluginHelper)this;
              helper.about_text = aboutStr;
              helper.SetIcons(ImageConverter.ImageToIpicture(smallImage),
            ImageConverter.ImageToIpicture(largeImage));
              UpdateTitle();
        }
コード例 #3
0
ファイル: Plugin.cs プロジェクト: aachyee/desktopgadgets
        void Initialize()
        {
            Log.Debug("Called Initialize()");
            // initialize variables

            Bitmap smallImage = null;
            Bitmap largeImage = null;

            try
            {

                Log.Debug("Loading Paths");

                RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Imagine Interactive\Gameserver Panel");
                installPath = key.GetValue("path").ToString();
                Log.Debug("InstallPath: "+installPath);

                RegistryKey cat = key.OpenSubKey("Categories");
                displayGroup = cat.GetSubKeyNames().GetValue(0).ToString();
                cat.Close();

                key.Close();
                qstatPath = installPath+@"\qstat\qstat.exe";
                Log.Debug("Qstat: "+qstatPath);

                contentLayout = GoogleDesktopDisplayContentItemLayout.GDD_CONTENT_ITEM_LAYOUT_NOWRAP_ITEMS;

                // Load our icons
                smallImage = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(
                    "GameserverPanel.iconSmall.gif"));

                largeImage = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(
                    "GameserverPanel.iconLarge.gif"));
            }
            catch (Exception e)
            {
                Log.Error(e.Message);
            }

            try
            {
                // Set plugin information
                IGoogleDesktopDisplayPluginHelper2 helper = (IGoogleDesktopDisplayPluginHelper2)this;
                helper.about_text = aboutStr;
                helper.SetIcons(ImageConverter.ImageToIpicture(smallImage),
                        ImageConverter.ImageToIpicture(largeImage));
                UpdateTitle();
            }
            catch (Exception e)
            {
                Log.Error(e.Message);
            }
            Log.Debug("Executed Initialize()");
        }