Exemplo n.º 1
0
 private void DetachFromProfile()
 {
     FileIOHandler.LoadEmbeddedData(FileName, this);
     _fullChannels.Clear();
     _fullChannels.AddRange(_profile.FullChannels);
     _profile = null;
     UpdateEventValueArray();
 }
Exemplo n.º 2
0
 public void ReloadProfile()
 {
     if (_profile == null)
     {
         return;
     }
     _profile = FileIOHandler.OpenProfile(_profile.FileName);
     LoadFromProfile();
 }
Exemplo n.º 3
0
        private void AttachToProfile(string profileName)
        {
            var path = Path.Combine(Paths.ProfilePath, profileName + Vendor.ProfileExtension);

            if (File.Exists(path))
            {
                if (null == FileIOHandler)
                {
                    FileIOHandler = FileIOHelper.GetProfileVersion(path);
                }
                // todo this could have the same issue with mismatch as another issue
                AttachToProfile(FileIOHandler.OpenProfile(path));
                Groups = _profile.Groups;
            }
            else
            {
                FileIOHandler.LoadEmbeddedData(FileName, this);
            }
        }
Exemplo n.º 4
0
        public void InitializeComponents()
        {
            this.fileIOHandler = new FileIOHandler(this);
            /*this.contextMenu = new ContextMenuStrip();*/
            this.contextMenu = new ContextMenu();

            /*
             * this.menuItemOpen = new ToolStripMenuItem();
             * this.menuItemClose = new ToolStripMenuItem();
             * this.menuItemCopy = new ToolStripMenuItem();
             * this.menuItemDelete = new ToolStripMenuItem();
             * this.menuItemEdit = new ToolStripMenuItem();
             * this.menuItemProperties = new ToolStripMenuItem();
             * this.menuItemRename = new ToolStripMenuItem();
             * this.menuItemRotateLeft = new ToolStripMenuItem();
             * this.menuItemRotateRight = new ToolStripMenuItem();
             * this.menuItemSetBG = new ToolStripMenuItem();
             * this.menuItemZoomIn = new ToolStripMenuItem();
             * this.menuItemZoomOut = new ToolStripMenuItem();
             */
            this.menuItemOpen  = new MenuItem();
            this.menuItemClose = new MenuItem();
            this.menuItemCopy  = new MenuItem();
            //this.menuItemDelete = new MenuItem();
            this.menuItemExploreDirectory = new MenuItem();
            //this.menuItemEdit = new MenuItem();
            //this.menuItemProperties = new MenuItem();
            //this.menuItemRename = new MenuItem();
            this.menuItemRotateLeft  = new MenuItem();
            this.menuItemRotateRight = new MenuItem();
            this.menuItemSetBG       = new MenuItem();
            this.menuItemZoomIn      = new MenuItem();
            this.menuItemZoomOut     = new MenuItem();
            this.menuItemSplitter    = new MenuItem();
            this.menuItemSplitter2   = new MenuItem();
            this.menuItemSplitter3   = new MenuItem();
            this.menuItemSplitter4   = new MenuItem();
            this.menuItemSplitter5   = new MenuItem();
            //
            //contextMenu
            //
            this.contextMenu.MenuItems.AddRange(new MenuItem[] {
                //this.contextMenu.Items.AddRange(new ToolStripItem[]{
                menuItemZoomIn,
                menuItemZoomOut,
                menuItemSplitter,
                menuItemRotateRight,
                menuItemRotateLeft,
                menuItemSplitter2,
                menuItemSetBG,
                menuItemSplitter3,
                menuItemExploreDirectory,
                //menuItemEdit,
                menuItemCopy,
                //menuItemRename,
                //menuItemDelete,
                menuItemSplitter4,
                menuItemOpen,
                menuItemClose,
                //menuItemSplitter5,
                //menuItemProperties,
            });
            //
            //menuItemZoomIn
            //
            this.menuItemZoomIn.Name    = "zoomIn";
            this.menuItemZoomIn.Text    = "Zoom &In";
            this.menuItemZoomIn.Enabled = false;
            this.menuItemZoomIn.Click  += new EventHandler(menuItemZoomIn_Click);
            //
            //menuItemZoomOut
            //
            this.menuItemZoomOut.Name    = "zoomOut";
            this.menuItemZoomOut.Text    = "Zoom &Out";
            this.menuItemZoomOut.Enabled = false;
            this.menuItemZoomOut.Click  += new EventHandler(menuItemZoomOut_Click);
            //
            //menuItemRotateRight
            //
            this.menuItemRotateRight.Name    = "rotateRight";
            this.menuItemRotateRight.Text    = "Rotate Clockwise";
            this.menuItemRotateRight.Enabled = false;
            this.menuItemRotateRight.Click  += new EventHandler(menuItemRotateRight_Click);
            //
            //menuItemRotateLeft
            //
            this.menuItemRotateLeft.Name    = "rotateLeft";
            this.menuItemRotateLeft.Text    = "Rotate Anti-clockwise";
            this.menuItemRotateLeft.Enabled = false;
            this.menuItemRotateLeft.Click  += new EventHandler(menuItemRotateLeft_Click);

            /*
             * //
             * //menuItemEdit
             * //
             * this.menuItemEdit.Name = "edit";
             * this.menuItemEdit.Text = "Edit...";
             * this.menuItemEdit.Enabled = false;
             * this.menuItemEdit.Click += new EventHandler(menuItemEdit_Click);
             */
            //
            //menuItemExploreDirectory
            //
            this.menuItemExploreDirectory.Name = "exploredirectory";
            this.menuItemExploreDirectory.Text = "Explore picture directory";
            //this.menuItemExploreDirectory.Image = exploreIcon;
            this.menuItemExploreDirectory.Click += new EventHandler(menuItemExploreDirectory_Click);
            //
            //menuItemCopy
            //
            this.menuItemCopy.Name     = "copy";
            this.menuItemCopy.Text     = "C&opy...";
            this.menuItemCopy.Enabled  = false;
            this.menuItemCopy.Shortcut = Shortcut.CtrlC;
            this.menuItemCopy.Click   += new EventHandler(menuItemCopy_Click);

            /*
             * //
             * //menuItemRename
             * //
             * this.menuItemRename.Name = "rename";
             * this.menuItemRename.Text = "Rename...";
             * this.menuItemRename.Enabled = false;
             * this.menuItemRename.Click += new EventHandler(menuItemRename_Click);
             * //
             * //menuItemDelete
             * //
             * this.menuItemDelete.Name = "delete";
             * this.menuItemDelete.Text = "&Delete...";
             * this.menuItemDelete.Enabled = false;
             * this.menuItemDelete.Click += new EventHandler(menuItemDelete_Click);
             */
            //
            //menuItemClose
            //
            this.menuItemClose.Name    = "close";
            this.menuItemClose.Text    = "&Close...";
            this.menuItemClose.Enabled = false;
            this.menuItemClose.Click  += new EventHandler(menuItemClose_Click);
            //
            //menuItemOpen
            //
            this.menuItemOpen.Name    = "open";
            this.menuItemOpen.Text    = "&Open...";
            this.menuItemOpen.Enabled = true;
            this.menuItemOpen.Click  += new EventHandler(menuItemOpen_Click);
            //
            //menuItemSetBG
            //
            this.menuItemSetBG.Name    = "setbackground";
            this.menuItemSetBG.Text    = "&Set as background...";
            this.menuItemSetBG.Enabled = false;
            this.menuItemSetBG.Click  += new EventHandler(menuItemSetBG_Click);

            /*
             * //
             * //menuItemProperties
             * //
             * this.menuItemProperties.Name = "properties";
             * this.menuItemProperties.Text = "P&roperties...";
             * this.menuItemProperties.Enabled = false;
             * this.menuItemProperties.Click += new EventHandler(menuItemProperties_Click);
             */
            ///*
            //
            //menuItemSplitter
            //
            this.menuItemSplitter.Name = "menuItemSplitter";
            this.menuItemSplitter.Text = "-";
            //
            //menuItemSplitter2
            //
            this.menuItemSplitter2.Name = "menuItemSplitter2";
            this.menuItemSplitter2.Text = "-";
            //
            //menuItemSplitter3
            //
            this.menuItemSplitter3.Name = "menuItemSplitter3";
            this.menuItemSplitter3.Text = "-";
            //
            //menuItemSplitter4
            //
            this.menuItemSplitter4.Name = "menuItemSplitter4";
            this.menuItemSplitter4.Text = "-";
            //
            //menuItemSplitter5
            //
            this.menuItemSplitter5.Name = "menuItemSplitter5";
            this.menuItemSplitter5.Text = "-";
            //*/
        }