Example #1
0
		public PanelButton(XCore.ChoiceBase choice, ImageCollection images):base()
		{
			m_images = images;

			this.Dock = System.Windows.Forms.DockStyle.Right;
			this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.Location = new System.Drawing.Point(576, 2);
			this.Name = "panelEx1";
			this.Anchor = System.Windows.Forms.AnchorStyles.None;
			this.Size = new System.Drawing.Size(120, 20);
#if USE_DOTNETBAR
			this.Style.Alignment = System.Drawing.StringAlignment.Center;
			this.Style.GradientAngle = 90;
#endif

			this.MouseEnter += new EventHandler(panelButton_MouseEnter);
			this.MouseLeave += new EventHandler(panelButton_MouseLeave);
			this.MouseDown += new MouseEventHandler(panelButton_MouseDown);

			this.Click += new EventHandler(PanelButton_Click);
			this.TabIndex = 0;

			this.Tag = choice;
			SetLabel();
		}
        //LOGO lấy từ FrameworkParams.ReportHeaderImage
        public CompanyInfoHeaderStartTitleGridEndFooter()
        {
            CompanyInfo info = DACompanyInfo.Instance.load();

            //Lấy logo
            ImageConverter ic = new ImageConverter();
            Image img = (Image)ic.ConvertFrom(info.logo);

            ImageCollection images = new ImageCollection();
            images.ImageSize = new Size(48, 48);
            images.AddImage(img);

            ReportHeaderImage = images.Images[0];

            //Lay Info
            String blank = "                      ";
            StringBuilder str = new StringBuilder("");

            if (info.name != null) str.AppendLine(blank + info.name);
            if (info.address != null) str.AppendLine(blank + "Địa chỉ: " + info.address);
            if (info.phone != null) str.Append(blank + "Điện thoại: " + info.phone);
            if (info.fax != null) str.Append("   Fax: " + info.fax);
            str.AppendLine();
            if (info.email != null) str.Append(blank + "Email: " + info.email);
            if (info.website != null) str.Append("   Website: " + info.website);

            RichTextBox r = new RichTextBox();
            r.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            r.Text = str.ToString();
            rtfGridHeader = r.Rtf;
        }
Example #3
0
 private ImageSet(ImageCollection collection, int index)
 {
     this.Index = index;
     this.RawStream = new MemoryStream(3 * 1024 * 1024);
     this.m_collection = collection;
     this.IsLoading  = new ManualResetEvent(false);
 }
 public ImageCollection FetchAll()
 {
     ImageCollection coll = new ImageCollection();
     Query qry = new Query(Image.Schema);
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
Example #5
0
        public static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                Console.WriteLine("ERROR: No output filename specified");
                return;
            }

            if (args.Length < 2)
            {
                Console.WriteLine("ERROR: At least one input file must be specified");
                return;
            }

            using(ImageCollection collection = new ImageCollection())
            {
                string outputFilename = args[0];

                foreach(var fn in args.Skip(1))
                {
                    collection.Add(new Bitmap(fn));
                }

                using(Bitmap b = collection.Render())
                {
                    VHDLConverter c = new VHDLConverter(b);

                    c.Save(outputFilename);
                }

                Console.WriteLine("Output written to {0}", outputFilename);
            }
        }
Example #6
0
File: Gfx.cs Project: rinat/battle
        private Gfx()
        {
            var images = new ImageCollection();
            // walls
            images.AddImage("walls", "Resources/gfx/blocks/green-wall.png");
            images.AddImage("trees", "Resources/gfx/blocks/tree-wall.png");

            // players
            images.AddImage("player-movement", "Resources/gfx/tanks/tank.png");
            images.AddImage("enemy-movement", "Resources/gfx/tanks/enemy.png");
            images.AddImage("player-bullet-flight", "Resources/gfx/bullets/bullet.png");

            // menu
            images.AddImage("game-menu-background", "Resources/gfx/menu/title.png");
            images.AddImage("game-ground", "Resources/gfx/menu/title.png");

            // bonus
            images.AddImage("bonus-boom", "Resources/gfx/bonus/boom.png");
            images.AddImage("bonus-health", "Resources/gfx/bonus/health.png");
            images.AddImage("bonus-life", "Resources/gfx/bonus/life.png");

            m_worldTexture = new Texture(images, PixelFormat.DefaultAlpha);

            UnitExplosion = new ParticleEffect("Resources/gfx/particles/rocket-explosion-smoke.peff");
            RocketExplosionParticleEffect = new ParticleEffect("Resources/gfx/particles/rocket-explosion.peff");
        }
Example #7
0
        public ImageSet(ImageCollection collection, int index, DataTypes type, object dataObject)
            : this(collection, index)
        {
            this.DataType   = type;
            this.DataObject = dataObject;

            this.Status = Statues.None;
        }
Example #8
0
        public ImageSet(ImageCollection collection, int index, Image image)
            : this(collection, index)
        {
            this.DataType = DataTypes.Image;
            this.Image = image;

            this.Status = Statues.Success;
        }
Example #9
0
		public System.Windows.Forms.Control Init (System.Windows.Forms.Form window,  ImageCollection smallImages, ImageCollection largeImages, Mediator mediator)
		{
			m_window = window;
			m_smallImages = smallImages;
			m_largeImages = largeImages;
			m_menuBar = new CommandBar(CommandBarStyle.Menu);

			return null; //this is not available yet. caller should call GetCommandBarManager() after CreateUIForChoiceGroupCollection() is called
		}
 private static void LoadImages()
 {
     if (imageList == null)
     {
         imageList = new ImageCollection();
         imageList.AddImage(DevExpress.Images.ImageResourceCache.Default.GetImage("images/actions/additem_16x16.png"));
         imageList.AddImage(DevExpress.Images.ImageResourceCache.Default.GetImage("images/edit/delete_16x16.png"));
     }
 }
Example #11
0
 private DTOImageCollection ConvertToDTOImageCollection(ImageCollection tempList)
 {
     DTOImageCollection returnList = new DTOImageCollection();
     foreach (Image d in tempList)
     {
         DTOImage tempImage = Mapper.Map<DTOImage>(d);
         returnList.Add(tempImage);
     }
     return returnList;
 }
Example #12
0
        //////////////////////////////////////////////////////////////////////////
        public frmUpload(ImageCollection ic, bool mainWnd = false)
        {
            InitializeComponent();
            this.Icon = TiX.Properties.Resources.TiX;

            this.ShowInTaskbar = mainWnd;

            this.m_ic = ic;

            this.Text = String.Format("{0} (1-1 / {1})", TiXMain.ProductName, ic.Count);
            this.lblLength.Text = String.Format("0 / {0}", TextLength);
        }
        public MainWindow()
        {
            InitializeComponent();

            imageCollection2 = new ImageCollection();
            imageCollection1 = new ImageCollection();

            // On lie la collectionau ObjectDataProvider déclaré dans le fichier XAML
            ObjectDataProvider imageSource1 = (ObjectDataProvider)FindResource("ImageCollection1");
            ObjectDataProvider imageSource2 = (ObjectDataProvider)FindResource("ImageCollection2");
            imageSource1.ObjectInstance = imageCollection1;
            imageSource2.ObjectInstance = imageCollection2;
        }
Example #14
0
        public static RepositoryItemImageComboBox GetCotDuyet()
        {
            ImageCollection imglist = new ImageCollection();
            FWImageDic.GET_DUYET_STATUS16(imglist);

            DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox itemImageComboBox = new DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox();
            itemImageComboBox.SmallImages = imglist;
            itemImageComboBox.Items.AddRange(
                new object[] { new DevExpress.XtraEditors.Controls.ImageComboBoxItem("Chưa duyệt", "1", 0),
                               new DevExpress.XtraEditors.Controls.ImageComboBoxItem("Duyệt", "2", 1),
                               new DevExpress.XtraEditors.Controls.ImageComboBoxItem("Không duyệt", "3", 2) });
            itemImageComboBox.GlyphAlignment = DevExpress.Utils.HorzAlignment.Center;

            return itemImageComboBox;
        }
Example #15
0
		public PanelMenu(XCore.ChoiceGroup group, ImageCollection images, XCore.IUIMenuAdapter menuBarAdapter):base()
		{
			m_group = group;
			m_images = images;
			m_menuBarAdapter = menuBarAdapter;

			this.Dock = System.Windows.Forms.DockStyle.Right;
			this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.Location = new System.Drawing.Point(576, 2);
#if USE_DOTNETBAR
			this.Name = "panelEx1";
#else
			this.Name = "panel1";
#endif
			this.Anchor = System.Windows.Forms.AnchorStyles.None;
			this.Size = new System.Drawing.Size(16, 16);
#if USE_DOTNETBAR
			this.Style.BackgroundImagePosition = eBackgroundImagePosition.Center;
#endif

//			this.StyleMouseOver.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemHotBackground;
//			this.StyleMouseOver.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemHotBackground2;
//			this.StyleMouseOver.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemHotText;

#if USE_DOTNETBAR
			this.StyleMouseOver.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
			this.StyleMouseOver.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
			this.StyleMouseOver.BorderWidth = 1;


			this.Style.Alignment = System.Drawing.StringAlignment.Center;
			//			this.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
			//			this.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
			//			this.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
			//			this.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
			//			this.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
			this.StyleMouseOver.Alignment = StringAlignment.Center;
			this.Style.GradientAngle = 90;
#endif
			this.Click +=new EventHandler(PanelMenu_Click);
			this.TabIndex = 0;

			//	this.Click += new EventHandler(m_infoBarButton_Click);
			this.Tag = group;

			Display();
			//	UpdateInfoBarButtonImage();
		}
Example #16
0
 public DocumentNodeOrLink(ImageCollection iclLarge)
 {
     try
     {
         InitializeComponent();
         for (int i = 0; i < iclLarge.Images.Count; i++)
             icbxIcon.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ImageComboBoxItem("", i, i));
         icbxIcon.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ImageComboBoxItem("Geen"));
         icbxIcon.Properties.LargeImages = iclLarge;
         radioGroup.SelectedIndex = 1;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public void GenerateXml_OneItem()
 {
   var ic = new ImageCollection("png", "0000", 800, 600);
   ic.AddPostId(1);
   var actual = ic.GenerateXml("../../");
   Assert.AreEqual(
       "<Collection"
     + " MaxLevel=\"7\" TileSize=\"256\""
     + " Format=\"png\" NextItemId=\"2\""
     + " xmlns=\"http://schemas.microsoft.com/deepzoom/2008\""
     + ">\r\n"
     + "  <Items>\r\n"
     + "    <I N=\"0\" Id=\"1\" Source=\"../../0001.dzi\">\r\n"
     + "      <Size Width=\"800\" Height=\"600\" />\r\n"
     + "    </I>\r\n"
     + "  </Items>\r\n"
     + "</Collection>", actual.ToString());
 }
Example #18
0
        public DocumentLink(ImageCollection iclLarge,string name,int imageIndex,string url)
        {
            try
            {
                InitializeComponent();
                for (int i = 0; i < iclLarge.Images.Count; i++)
                    icbxIcon.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ImageComboBoxItem("", i, i));
                icbxIcon.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ImageComboBoxItem("Geen"));
                icbxIcon.Properties.LargeImages = iclLarge;
                txtUrl.Text = url;
                txtName.Text = name;

                icbxIcon.SelectedIndex = imageIndex >= 0 && imageIndex < iclLarge.Images.Count ? imageIndex : iclLarge.Images.Count;

            }
            catch (Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
Example #19
0
        public PanelButton(XCore.ChoiceBase choice, ImageCollection images)
            : base()
        {
            m_images = images;

            this.Dock = System.Windows.Forms.DockStyle.Right;
            this.Font = new System.Drawing.Font("Tahoma", 13F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.Location = new System.Drawing.Point(576, 2);
            this.Name = "panelEx1";
            this.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.Size = new System.Drawing.Size(120, 20);

            this.MouseEnter += new EventHandler(panelButton_MouseEnter);
            this.MouseLeave += new EventHandler(panelButton_MouseLeave);
            this.MouseDown += new MouseEventHandler(panelButton_MouseDown);

            this.Click += new EventHandler(PanelButton_Click);
            this.TabIndex = 0;

            this.Tag = choice;
            SetLabel();
        }
Example #20
0
        public PanelMenu(XCore.ChoiceGroup group, ImageCollection images, XCore.IUIMenuAdapter menuBarAdapter)
            : base()
        {
            m_group = group;
            m_images = images;
            m_menuBarAdapter = menuBarAdapter;

            this.Dock = System.Windows.Forms.DockStyle.Right;
            this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.Location = new System.Drawing.Point(576, 2);
            this.Name = "panel1";
            this.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.Size = new System.Drawing.Size(16, 16);

            this.Click +=new EventHandler(PanelMenu_Click);
            this.TabIndex = 0;

            //	this.Click += new EventHandler(m_infoBarButton_Click);
            this.Tag = group;

            Display();
            //	UpdateInfoBarButtonImage();
        }
Example #21
0
        public MainWindow()
        {
            InitializeComponent();

            // On crée notre collection d'image et on y ajoute deux images
            imageCollection1 = new ImageCollection();
            imageCollection1.Add(new ImageObjet("Chrysanthemum",
            lireFichier(@"d:\Chrysanthemum.jpg")));
            imageCollection1.Add(new ImageObjet("Hydrangeas",
            lireFichier(@"d:\Hydrangeas.jpg")));
            // On lie la collection ObjectDataProvider déclaré dans le fichier XAML
            ObjectDataProvider imageSource = (ObjectDataProvider)FindResource("ImageCollection1");
            imageSource.ObjectInstance = imageCollection1;

            // On crée notre collection d'image et on y ajoute deux images
            imageCollection2 = new ImageCollection();
            imageCollection2.Add(new ImageObjet("Penguins",
            lireFichier(@"d:\Penguins.jpg")));
            imageCollection2.Add(new ImageObjet("Koala",
            lireFichier(@"d:\Koala.jpg")));
            // On lie la collectionau ObjectDataProvider déclaré dans le fichier XAML
            ObjectDataProvider imageSource2 = (ObjectDataProvider)FindResource("ImageCollection2");
            imageSource2.ObjectInstance = imageCollection2;
        }
        private void ImageRecognitionInWPF()
        {
            RecognitionStatus = true;

            List <StringPathAndImage> strings = new List <StringPathAndImage>();

            foreach (var path in Directory.GetFiles(ChosenDirectoryPath, "*.jpg"))
            {
                StringPathAndImage str = new StringPathAndImage
                {
                    Path  = path,
                    Image = Convert.ToBase64String(File.ReadAllBytes(path))
                };
                strings.Add(str);
            }

            ThreadPool.QueueUserWorkItem(new WaitCallback(async MagicParameter =>
            {
                try
                {
                    var content = new StringContent(JsonConvert.SerializeObject(strings), Encoding.UTF8, "application/json");
                    HttpResponseMessage httpResponse;
                    try
                    {
                        httpResponse = await client.PostAsync(url, content, cts.Token);
                    }
                    catch (HttpRequestException)
                    {
                        await dispatcher.BeginInvoke(new Action(() =>
                        {
                            MessageBox.Show("The connection with server is lost...");
                            Stop();
                        }));

                        return;
                    }

                    if (httpResponse.IsSuccessStatusCode)
                    {
                        var item = JsonConvert.DeserializeObject <List <RecognizedImage> >(httpResponse.Content.ReadAsStringAsync().Result);
                        foreach (var image in item)
                        {
                            await dispatcher.BeginInvoke(new Action(() =>
                            {
                                ImageCollection.Add(new ImagePathClassLabelProbability()
                                {
                                    Image       = LoadImage(Convert.FromBase64String(image.Image)),
                                    Path        = image.Path,
                                    ClassLabel  = image.ClassLabel,
                                    Probability = image.Probability
                                });
                                AllClassLabels label = AllClassLabelsCollection.First(element => element.ClassLabel == Convert.ToString(image.ClassLabel));
                                label.NumberOfTimes++;
                            }));
                        }
                        RecognitionStatus = false;
                    }
                }

                catch (OperationCanceledException)
                {
                    await dispatcher.BeginInvoke(new Action(() =>
                    {
                        MessageBox.Show("The recognition process was stopped.");
                    }));
                }
            }));
        }
Example #23
0
        private void ConfigGridColumns()
        {
            var view = grdTransfer.MainView as GridView;

            if (view == null)
            {
                return;
            }
            var itemProgressBar = new RepositoryItemProgressBar
            {
                ReadOnly    = true,
                Enabled     = false,
                BorderStyle = BorderStyles.NoBorder,
                Maximum     = 100,
                Minimum     = 0,
                NullText    = string.Empty,
                PercentView = false,
                ShowTitle   = true
            };

            itemProgressBar.DisplayFormat.FormatType = FormatType.Numeric;
            itemProgressBar.CustomDisplayText       += OnProgressBarCustomDisplayText;

            foreach (GridColumn col in view.Columns)
            {
                col.OptionsColumn.AllowEdit = false;
                if (col.FieldName == ColumnNamesOfTransferTable.Container.ToString())
                {
                    col.Visible = true;
                    col.Caption = PKSimConstants.ProteinExpressions.ColumnCaptions.Transfer.COL_CONTAINER;
                    var itemImageComboBox = new RepositoryItemImageComboBox {
                        ReadOnly = true
                    };
                    var smallImages = new ImageCollection();
                    itemImageComboBox.SmallImages = smallImages;
                    itemImageComboBox.Items.BeginUpdate();
                    var dv = view.DataSource as DataView;
                    if (dv != null)
                    {
                        var dt = dv.ToTable();
                        foreach (DataRow dr in dt.Rows)
                        {
                            string          container   = dr[ColumnNamesOfTransferTable.Container.ToString()].ToString();
                            string          displayName = dr[ColumnNamesOfTransferTable.DisplayName.ToString()].ToString();
                            ApplicationIcon icon        = ApplicationIcons.IconByName(container);
                            if (icon != null && icon != ApplicationIcons.EmptyIcon)
                            {
                                smallImages.AddImage(icon.ToImage());
                                itemImageComboBox.Items.Add(new ImageComboBoxItem(displayName, container, smallImages.Images.Count - 1));
                            }
                            else
                            {
                                itemImageComboBox.Items.Add(new ImageComboBoxItem(displayName, container));
                            }
                        }
                    }
                    itemImageComboBox.Items.EndUpdate();
                    col.ColumnEdit = itemImageComboBox;
                    col.SortOrder  = ColumnSortOrder.Ascending;
                }
                else if (col.FieldName == ColumnNamesOfTransferTable.DisplayName.ToString())
                {
                    col.Visible = false;
                }
                else if (col.FieldName == ColumnNamesOfTransferTable.RelativeExpressionOld.ToString())
                {
                    col.Visible = false;
                }
                else if (col.FieldName == ColumnNamesOfTransferTable.ExpressionValue.ToString())
                {
                    col.Visible = false;
                }
                else if (col.FieldName == ColumnNamesOfTransferTable.Unit.ToString())
                {
                    col.Visible = false;
                }
                else if (col.FieldName == string.Concat(ColumnNamesOfTransferTable.RelativeExpressionOld.ToString(), STR_Percentage))
                {
                    col.Caption = PKSimConstants.ProteinExpressions.ColumnCaptions.Transfer.COL_OLDVALUE;
                    col.Visible = _presenter.ShowOldValues;
                    col.OptionsColumn.AllowEdit = false;
                    col.ColumnEdit = itemProgressBar;
                }
                else if (col.FieldName == ColumnNamesOfTransferTable.RelativeExpressionNew.ToString())
                {
                    col.Visible = false;
                }
                else if (col.FieldName == string.Concat(ColumnNamesOfTransferTable.RelativeExpressionNew.ToString(), STR_Percentage))
                {
                    col.Caption = PKSimConstants.ProteinExpressions.ColumnCaptions.Transfer.COL_NEWVALUE;
                    col.OptionsColumn.AllowEdit = false;
                    col.ColumnEdit = itemProgressBar;
                }
            }
        }
Example #24
0
 public ImageItem(Leadtools.RasterImage rasterImage, ImageCollection parent, object tag)
 {
     _rasterImage = rasterImage;
     _tag         = tag;
     _parent      = parent;
 }
Example #25
0
        public void RemoveGroup(int index)
        {
            if (mode == ThumbMode.Expanded)
            {
                return;
            }

            GroupBox        grpBox     = this.Controls[index] as GroupBox;
            ImageCollection collection = _lstImageCollection[index];

            //Store Collapsed
            List <bool> bExpansionStatus = new List <bool>();

            foreach (Control cntrl in this.Controls)
            {
                bExpansionStatus.Add((bool)cntrl.Controls[0].Tag);
            }

            //GroupCheck status
            List <CheckState> bGroupCheck = new List <CheckState>();

            foreach (Control cntrl in this.Controls)
            {
                bGroupCheck.Add((CheckState)cntrl.Tag);
            }

            foreach (ListItem listItem in Items)
            {
                if (listItem.ImageItem.Parent == collection)
                {
                    listItem.Dispose();
                }
            }

            collection.Images.Clear();

            _lstImageCollection.RemoveAt(index);
            bExpansionStatus.RemoveAt(index);
            bGroupCheck.RemoveAt(index);
            collection = null;

            UpdateGroups();

            //Restore Collapsed
            for (int i = 0; i < bExpansionStatus.Count; i++)
            {
                if (bExpansionStatus[i])
                {
                    Expand(this.Controls[i] as GroupBox);
                }
                else
                {
                    Collapse(this.Controls[i] as GroupBox);
                }
            }

            for (int i = 0; i < bGroupCheck.Count; i++)
            {
                this.Controls[i].Tag = bGroupCheck[i];
            }

            if (ListStateChanged != null)
            {
                ListStateChanged.Invoke(this, null);
            }
        }
Example #26
0
 public ImageCollection FetchByQuery(Query qry)
 {
     ImageCollection coll = new ImageCollection();
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
Example #27
0
        private void DeleteItemCondensed(int index)
        {
            ListItem itemtodelete = Items[index];
            GroupBox grpBox       = (itemtodelete._Controls).Parent as GroupBox;
            bool     bExpanded    = (bool)grpBox.Controls[0].Tag;

            int             iGroup     = Controls.IndexOf(grpBox);
            ImageCollection collection = _lstImageCollection[iGroup];

            //Store Collapsed
            List <bool> bExpansionStatus = new List <bool>();

            foreach (Control cntrl in this.Controls)
            {
                bExpansionStatus.Add((bool)cntrl.Controls[0].Tag);
            }

            //GroupCheck status
            List <CheckState> bGroupCheck = new List <CheckState>();

            foreach (Control cntrl in this.Controls)
            {
                bGroupCheck.Add((CheckState)cntrl.Tag);
            }

            itemtodelete.Selected = false;
            if (!bExpanded)
            {
                //RemoveGroup
                foreach (ListItem listItem in Items)
                {
                    if (listItem.ImageItem.Parent == collection)
                    {
                        listItem.Dispose();
                    }
                }
                collection.Images.Clear();
            }
            else
            {
                //RemoveItem
                itemtodelete.Dispose();
                collection.Images.Remove(itemtodelete.ImageItem);
            }

            if (collection.Images.Count == 0)
            {
                _lstImageCollection.RemoveAt(iGroup);
                bExpansionStatus.RemoveAt(iGroup);
                bGroupCheck.RemoveAt(iGroup);
                collection = null;
            }

            //Store Selected
            List <bool> bSelectionStatus = new List <bool>();

            foreach (ListItem lstItem in this.Items)
            {
                bSelectionStatus.Add(lstItem.Selected);
            }


            UpdateGroups();

            //Restore Collapsed
            for (int i = 0; i < bExpansionStatus.Count; i++)
            {
                if (bExpansionStatus[i])
                {
                    Expand(this.Controls[i] as GroupBox);
                }
                else
                {
                    Collapse(this.Controls[i] as GroupBox);
                }
            }

            for (int i = 0; i < bGroupCheck.Count; i++)
            {
                this.Controls[i].Tag = bGroupCheck[i];
            }

            //Restore Selected
            for (int i = 0; i < Items.Count; i++)
            {
                Items[i].Selected = bSelectionStatus[i];
            }
        }
Example #28
0
        static int Main(string[] args)
        {
            if ((args.Length == 4) && args[0].Equals("install", StringComparison.OrdinalIgnoreCase))
                return (int)ShellExtension.Install(args[1] == "1", args[2] == "1", args[3], true);

            if (args.Length == 1 && args[0].Equals("uninstall", StringComparison.OrdinalIgnoreCase))
                return (int)ShellExtension.Uninstall(true);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TiX.ExternalLibrary.Resolver.Init(typeof(Properties.Resources));
            CrashReport.Init();

            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);

            #if !DEBUG
            System.Net.HttpWebRequest.DefaultWebProxy = null;
            #endif
            System.Net.HttpWebRequest.DefaultCachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore);
            System.Net.ServicePointManager.MaxServicePoints = 20;

            Settings.Load();
            TiXMain.Twitter.UserToken  = Settings.UToken;
            TiXMain.Twitter.UserSecret = Settings.USecret;

            int i;

            if (args.Length >= 1 && args[0].Equals("stasis", StringComparison.OrdinalIgnoreCase))
            {
                Image cropedImage;
                using (var stasisForm = new Stasisfield())
                {
                    Application.Run(stasisForm);
                    cropedImage = stasisForm.CropedImage;
                }

                if (cropedImage != null)
                {
                    if (args.Length == 3)
                        TweetModerator.Tweet(cropedImage, false, "캡처 화면 전송중", args[1], args[2]);
                    else
                        TweetModerator.Tweet(cropedImage, false, "캡처 화면 전송중");
                }

                return 0;
            }
            else if (args.Length >= 1)
            {
                var data = new ImageCollection();
                bool autoStart = args.Any(e => e.Equals("--notext", StringComparison.OrdinalIgnoreCase));

                var lst = new List<string>(args.Length);

                if (args.Any(e => e.Equals("--pipe", StringComparison.OrdinalIgnoreCase)))
                {
                    var reader = new StreamReader(Console.OpenStandardInput(), Encoding.UTF8);
                    string path;
                    while (true)
                    {
                        path = reader.ReadLine();
                        if (string.IsNullOrEmpty(path)) break;

                        if (CheckFile(path))
                            lst.Add(path);
                    }
                }
                else
                {
                    for (i = 0; i < args.Length; ++i)
                        if (CheckFile(args[i]))
                            lst.Add(args[i]);
                }

                if (lst.Count == 0) return 0;

                data.Add(lst);

                Application.Run(new frmUpload(data, true) { AutoStart = autoStart });
                return 0;
            }

            Form frm;
            using (var instance = new InstanceHelper(InstanceName))
            {
                if (instance.Check())
                {
                    if (String.IsNullOrEmpty(Settings.UToken) | String.IsNullOrEmpty(Settings.USecret))
                    {
                        using (frm = new frmPin())
                        {
                            Application.Run(instance.MainWindow = frm);

                            if (frm.DialogResult != DialogResult.OK)
                                return 0;
                        }
                    }

                    frm = new frmMain();
                    Application.Run(instance.MainWindow = frm);
                }
            }

            return 0;
        }
Example #29
0
        //public static void LoadModules(XtraForm frm, TreeList treeList)
        //{
        //    treeList.KeyFieldName = "Id";
        //    treeList.ParentFieldName = "ParentId";
        //    AppModule objModule = frm.Tag as AppModule;
        //    if (objModule != null)
        //    {
        //        foreach (ChucNang c in DataServices.ChucNang.GetByIDTrangThai(objModule.Id, true))
        //        {
        //            TList<ChucNang> listModules = DataServices.ChucNang.GetByMaNhomQuyenParentIDPhanLoaiTrangThai(UserInfo.GroupID, c.Id, "Module", true);
        //            if (listModules.Count > 0)
        //            {
        //                treeList.DataSource = listModules;
        //                return;
        //            }
        //        }
        //    }
        //}

        public void LoadModules(XtraForm frm, NavBarControl navControl, GroupControl pContainer, ImageCollection simageCollection)
        {
            AppContainer = pContainer;
            int      sIndex = 0;
            ChucNang cn     = frm.Tag as ChucNang;

            if (cn == null || !cn.TrangThai)
            {
                return;
            }

            List <ChucNang> dsGroup = _dataChucNang.LayDuLieu(cn.ModuleID, "Module", true);

            foreach (ChucNang grp in dsGroup)
            {
                //Group
                NavBarGroup group = new NavBarGroup(grp.ModuleName)
                {
                    Name = string.Format("navBarGroup{0}", grp.ModuleID), GroupStyle = NavBarGroupStyle.Default
                };
                if (grp.HinhAnh != null)
                {
                    simageCollection.AddImage(grp.HinhAnh);
                    group.SmallImageIndex = sIndex;
                    sIndex++;
                }
                //Item
                List <ChucNang> dsItem = _dataChucNang.LayDuLieu(grp.ModuleID, "Module", true);
                foreach (ChucNang i in dsItem)
                {
                    NavBarItem item = new NavBarItem(i.ModuleName)
                    {
                        Caption = i.ModuleName,
                        Hint    = i.ModuleName,
                        Name    = string.Format("navBarItem{0}{1}", i.ModuleID, grp.ModuleID),
                        Tag     = i
                                  //Tag = new AppModule() {
                                  //    Id = i.ModuleID,
                                  //    ModuleId = i.GUIName,
                                  //    Caption = i.ModuleName,
                                  //    Type = i.KieuForm,
                                  //    MethodName = i.TenPhuongThuc,
                                  //    Parameter = i.ThamSo
                                  //}
                    };
                    item.LinkClicked += NavItemClick;
                    if (i.HinhAnh != null)
                    {
                        simageCollection.AddImage(i.HinhAnh);
                        item.SmallImageIndex = sIndex;
                        sIndex++;
                    }
                    group.ItemLinks.Add(item);
                    navControl.Items.Add(item);
                }
                navControl.Groups.Add(group);
            }
            return;
        }
Example #30
0
 /// <summary>
 /// Rotator View Model Constructor.
 /// </summary>
 public RotatorViewModel()
 {
     ImageCollection.Add(new RotatorModel("image2.png"));
     ImageCollection.Add(new RotatorModel("image2.png"));
     ImageCollection.Add(new RotatorModel("image2.png"));
 }
        protected override void EndProcessing()
        {
            Utils.StartProfile("MapCmdlet");

            var map = new InnerMap()
            {
                EnableAnimation        = false,
                EnableScrolling        = false,
                EnableZooming          = false,
                EnableDelayedScrolling = false
            };

            map.NavigationPanelOptions.ShowCoordinates     = false;
            map.NavigationPanelOptions.ShowKilometersScale = false;
            map.NavigationPanelOptions.ShowMilesScale      = false;

            switch (CoordinateSystem)
            {
            case MapCoordinateSystem.Geo:
                map.CoordinateSystem = new GeoMapCoordinateSystem();
                break;

            case MapCoordinateSystem.Cartesian:
                map.CoordinateSystem = new CartesianMapCoordinateSystem();
                break;
            }

            if (map.CoordinateSystem is GeoMapCoordinateSystem geoCoordSystem)
            {
                switch (Projection ?? MapProjection.Default)
                {
                case MapProjection.Default:
                    //Leave projection as is
                    break;

                case MapProjection.BraunStereographic:
                    geoCoordSystem.Projection = new BraunStereographicProjection();
                    break;

                case MapProjection.EllipticalMercator:
                    geoCoordSystem.Projection = new EllipticalMercatorProjection();
                    break;

                case MapProjection.EqualArea:
                    geoCoordSystem.Projection = new EqualAreaProjection();
                    break;

                case MapProjection.Equidistant:
                    geoCoordSystem.Projection = new EquidistantProjection();
                    break;

                case MapProjection.Equirectangular:
                    geoCoordSystem.Projection = new EquirectangularProjection();
                    break;

                case MapProjection.Kavrayskiy:
                    geoCoordSystem.Projection = new KavrayskiyProjection();
                    break;

                case MapProjection.LambertCylindricalEqualArea:
                    geoCoordSystem.Projection = new LambertCylindricalEqualAreaProjection();
                    break;

                case MapProjection.Miller:
                    geoCoordSystem.Projection = new MillerProjection();
                    break;

                case MapProjection.Sinusoidal:
                    geoCoordSystem.Projection = new SinusoidalProjection();
                    break;

                case MapProjection.SphericalMercator:
                    geoCoordSystem.Projection = new SphericalMercatorProjection();
                    break;
                }
            }
            else if ((Projection ?? MapProjection.Default) != MapProjection.Default)
            {
                throw new Exception("Projection can be set only in Geo coordinate system.");
            }

            if (ImageList != null && ImageList.Length > 0)
            {
                ExecuteLocked(() =>
                {
                    var images = new ImageCollection();
                    if (ImageSize.HasValue)
                    {
                        images.ImageSize = ImageSize.Value;
                    }
                    foreach (var imageFile in ImageList)
                    {
                        var imagePath = Project.Current.MapPath(imageFile);
                        if (string.IsNullOrWhiteSpace(imagePath) || !System.IO.File.Exists(imagePath))
                        {
                            throw new Exception($"Cannot find image: '{imagePath}'.");
                        }
                        var bmp = new Bitmap(imagePath);
                        images.AddImage(bmp);
                    }
                    map.ImageList = images;
                }, LockFiles ? LockObject : null);
            }

            var backColor = Utils.ColorFromString(BackColor);

            if (backColor != Color.Empty)
            {
                map.BackColor = backColor;
            }

            var context = new MapContext()
            {
                Map = map
            };

            WriteObject(context);
        }
Example #32
0
        private void MyTree_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                sw.Restart();
                List <Sys_Menu> MenuData = (List <Sys_Menu>)Provider.UserMenus;
                Sys_Menu        sys_Menu = MenuData[MyTree.FocusedNode.Id];

                if (string.IsNullOrEmpty(sys_Menu.Menu_Page))
                {
                    return;
                }
                if (!IsMenuOpen(sys_Menu))
                {
                    ImageCollection ims = (ImageCollection)MyTree.SelectImageList;
                    if (ims != null)
                    {
                        barTip.ImageOptions.Image = ims.Images[sys_Menu.Menu_IconIndex];// MyTree.FocusedNode.ImageIndex sys_Menu.Menu_IconIndex;
                    }
                    Sys_Menu sys_Page = InitializePage(sys_Menu);
                    if (sys_Page != null)
                    {
                        ChildPage myPage = SharedFunc.LoadPage(sys_Page);
                        if (myPage == null)
                        {
                            myPage = new ChildPage();
                        }
                        myPage.SysMenu = sys_Menu;
                        switch ((Sys_Menu_Show)sys_Page.Menu_Show)
                        {
                        case Sys_Menu_Show.MdiChild:
                            myPage.MdiParent = this;
                            myPage.Show();
                            break;

                        case Sys_Menu_Show.Dialog:
                            myPage.ShowDialog();
                            break;

                        case Sys_Menu_Show.NewForm:
                            myPage.Show();
                            break;

                        default:
                            break;
                        }
                    }
                }
                barTip.Caption = TimeDiff(sw);
                barTip.Hint    = string.Empty;
            }
            catch (Exception ex)
            {
                SharedFunc.RaiseError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Example #33
0
        private static ImageCollection CreateImageCollection(TextureDescription description, bool skipMipLevel0 = false)
        {
            int numberOfImages, pixelSize;
              DetermineImages(description, out numberOfImages, out pixelSize);
              var images = new ImageCollection(numberOfImages);

              int index = 0;
              switch (description.Dimension)
              {
            case TextureDimension.Texture1D:
            case TextureDimension.Texture2D:
            case TextureDimension.TextureCube:
              Debug.Assert(description.ArraySize != 0);
              Debug.Assert(description.MipLevels > 0);

              for (int item = 0; item < description.ArraySize; item++)
              {
            int w = description.Width;
            int h = description.Height;

            for (int level = 0; level < description.MipLevels; level++)
            {
              if (!skipMipLevel0 || level != 0)
                images[index] = new Image(w, h, description.Format);

              index++;

              if (h > 1)
                h >>= 1;

              if (w > 1)
                w >>= 1;
            }
              }
              break;

            case TextureDimension.Texture3D:
              {
            Debug.Assert(description.MipLevels > 0);
            Debug.Assert(description.Depth > 0);

            int w = description.Width;
            int h = description.Height;
            int d = description.Depth;

            for (int level = 0; level < description.MipLevels; level++)
            {
              for (int slice = 0; slice < d; slice++)
              {
                // We use the same memory organization that Direct3D 11 needs for D3D11_SUBRESOURCE_DATA
                // with all slices of a given mip level being continuous in memory.
                if (!skipMipLevel0 || level != 0)
                  images[index] = new Image(w, h, description.Format);

                index++;
              }

              if (h > 1)
                h >>= 1;

              if (w > 1)
                w >>= 1;

              if (d > 1)
                d >>= 1;
            }
              }
              break;

            default:
              Debug.Fail("Unexpected texture dimension");
              break;
              }

              return images;
        }
Example #34
0
        /// <summary>
        /// Creates a new InvalidPluginStepRegistrationException due to the given missing required attribute.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="imageKeyName">Name of the image key.</param>
        /// <param name="attributes">The attributes.</param>
        /// <returns></returns>
        public static InvalidPluginStepRegistrationException ImageMissingRequiredAttributes(ImageCollection image, string imageKeyName, IEnumerable <string> attributes)
        {
            var local = attributes.ToArray();

            return(new InvalidPluginStepRegistrationException("{0} Entity Image \"{1}\" is missing required parameter{2} {3}!", image, imageKeyName, local.Length > 1 ? "s" : String.Empty, local.ToCsv()));
        }
Example #35
0
        private void FillGroupBox(ImageCollection imagecollection, GroupBox GroupBoxImageCollection)
        {
            Button ButtonExpansion = new Button();

            System.Windows.Forms.Panel PanelItem;
            GroupBoxImageCollection.BackColor = this.BackColor;
            GroupBoxImageCollection.Controls.Add(ButtonExpansion);

            //Button
            ButtonExpansion.Anchor    = ((AnchorStyles)((AnchorStyles.Top | ExpansionButtonLocation)));
            ButtonExpansion.FlatStyle = FlatStyle.Popup;
            ButtonExpansion.Image     = imgPlus;
            ButtonExpansion.BackColor = SystemColors.AppWorkspace;
            ButtonExpansion.Size      = new Size(15, 16);

            if (ExpansionButtonLocation == AnchorStyles.Left)
            {
                ButtonExpansion.Location = new Point(5, 14);
            }
            else
            {
                ButtonExpansion.Location = new Point(GroupBoxImageCollection.Width - 18, 8);
            }

            ButtonExpansion.Tag = false;
            GroupBoxImageCollection.Controls.Add(ButtonExpansion);

            ButtonExpansion.KeyDown          += new KeyEventHandler(ListImageBoxControls_KeyDown);
            GroupBoxImageCollection.KeyDown  += new KeyEventHandler(ListImageBoxControls_KeyDown);
            ButtonExpansion.GotFocus         += new EventHandler(ItemGotFocus);
            GroupBoxImageCollection.GotFocus += new EventHandler(ItemGotFocus);

            GroupBoxImageCollection.Tag  = false;
            GroupBoxImageCollection.Text = imagecollection.Name;
            ButtonExpansion.Click       += new EventHandler(ButtonExpansion_Click);

            //Add All Items
            int index = 0;
            int iExpansionDisplacment = 15;

            if (ExpansionButtonLocation == AnchorStyles.Right)
            {
                iExpansionDisplacment = 3;
            }

            foreach (ImageItem img in imagecollection.Images)
            {
                CreateItemPanel(img, "", index, out PanelItem);
                PanelItem.Location = new Point(index * PanelItem.Width + iExpansionDisplacment, 14);

                PanelItem.Controls[0].Controls[0].Click += new EventHandler(CondensedCheck_Click);
                index++;
                GroupBoxImageCollection.Controls.Add(PanelItem);
                if (img.Checked)
                {
                    Items.Add(new ListItem(CheckState.Checked, img, PanelItem, this));
                }
                else
                {
                    Items.Add(new ListItem(CheckState.Unchecked, img, PanelItem, this));
                }
            }
        }
Example #36
0
 static ImageCollection CreateFlagStatusImageCollection() {
     ImageCollection ret = new ImageCollection();
     ret.AddImage(Properties.Resources.Today_Flag);
     ret.AddImage(Properties.Resources.Tomorrow_Flag);
     ret.AddImage(Properties.Resources.ThisWeek_Flag);
     ret.AddImage(Properties.Resources.NextWeek_Flag);
     ret.AddImage(Properties.Resources.NoDate_Flag);
     ret.AddImage(Properties.Resources.Custom_Flag);
     ret.AddImage(Properties.Resources.Completed_16x16);
     return ret;
 }
Example #37
0
 public ImageList()
 {
     images = new ImageCollection(this);
 }
Example #38
0
        public static void InitTreeChonNhanVien_Choice1(PLDMTreeGroup tree, bool? IsAdd)
        {
            if (IsAdd == true)
            {
                tree.InitReadOnly("NAME", "V_PHONG_BAN_NHAN_VIEN_VISBLE", null, "ID", "PARENT_ID",
               new string[] { "NAME" },
               new string[] { "Nhân viên" });
            }
            else
            {

                tree.InitReadOnly("NAME", "V_PHONG_BAN_NHAN_VIEN", null, "ID", "PARENT_ID",
                    new string[] { "NAME" },
                    new string[] { "Nhân viên" });
            }
            PopupContainerControl popup = tree.Controls["popupContainerControl1"] as PopupContainerControl;
            if (popup == null) return;
            DMTreeGroup tr = popup.Controls["plGroupCatNew1"] as DMTreeGroup;
            if (tr == null) return;
            foreach (TreeListColumn col in tr.TreeList_1.Columns)
            {
                col.OptionsColumn.AllowFocus = false;
            }

            int IndexGroupImage = -1;
            int IndexImage = -1;
            int IndexRootImage = -1;
            tr.TreeList_1.SelectImageList = null;
            DataTable dt = tr.TreeList_1.DataSource as DataTable;
            ImageCollection imList = new ImageCollection();
            imList.ImageSize = new Size(20, 20);
            dt.DefaultView.Sort = "IS_GROUP DESC ,NAME ASC";
            Image rimg = ResourceMan.getImage("navNoiBaoHanh.png");
            Image gimg = ResourceMan.getImage("mnbKhachHangNhom.png");
            Image img = ResourceMan.getImage("mnbTTinKhachHang.png");
            if (gimg != null || img != null || rimg != null)
            {
                IndexRootImage = imList.Images.Add(rimg, "navNoiBaoHanh.png");
                IndexGroupImage = imList.Images.Add(gimg, "mnbKhachHangNhom.png");
                IndexImage = imList.Images.Add(img, "mnbTTinKhachHang.png");
                tr.TreeList_1.StateImageList = imList;
            }
            else tr.TreeList_1.StateImageList = null;
            tr.TreeList_1.OptionsView.ShowIndicator = false;

            tr.TreeList_1.GetStateImage += delegate(object sender, DevExpress.XtraTreeList.GetStateImageEventArgs e)
            {
                if (e.Node.Level == 0)
                {

                    e.Node.StateImageIndex = IndexRootImage;
                }
                else
                {
                    if (e.Node["IS_GROUP"].ToString() == "Y")
                    {
                        e.Node.StateImageIndex = IndexGroupImage;
                    }
                    else e.Node.StateImageIndex = IndexImage;
                }
            };
            tr.TreeList_1.FocusedNodeChanged += delegate(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
            {

                if (e.Node["IS_GROUP"].ToString() == "Y")
                {
                    tr.btnAdd.Owner.Items["btnSelect"].Enabled = false;
                }
                else
                {
                    tr.btnAdd.Owner.Items["btnSelect"].Enabled = true;

                }
            };
            long selected = -1;

            tree.popupContainerEdit1.Popup += delegate(object sender, EventArgs e)
               {
               selected = tree._getSelectedID();
               };
            tree.popupContainerEdit1.QueryCloseUp += delegate(object sender, System.ComponentModel.CancelEventArgs e)
            {
                if (tr.SelectedNode != null)
                {
                    if (tr.SelectedNode["IS_GROUP"].ToString() == "Y")
                    {
                        e.Cancel = true;
                        DevExpress.XtraTreeList.Nodes.TreeListNode n = tr.TreeList_1.FindNodeByFieldValue("ID", selected);
                        //if (n != null)
                        tr.SelectedNode = n;
                        tree._setSelectedID(selected);
                    }
                }
            };
        }
        void ReleaseDesignerOutlets()
        {
            if (Avatar != null)
            {
                Avatar.Dispose();
                Avatar = null;
            }

            if (BottomConstraint != null)
            {
                BottomConstraint.Dispose();
                BottomConstraint = null;
            }

            if (BottomRuler2 != null)
            {
                BottomRuler2.Dispose();
                BottomRuler2 = null;
            }

            if (IconBox != null)
            {
                IconBox.Dispose();
                IconBox = null;
            }

            if (ImageCollection != null)
            {
                ImageCollection.Dispose();
                ImageCollection = null;
            }

            if (Input != null)
            {
                Input.Dispose();
                Input = null;
            }

            if (InputBoxHieghtConstraint != null)
            {
                InputBoxHieghtConstraint.Dispose();
                InputBoxHieghtConstraint = null;
            }

            if (MentionUser != null)
            {
                MentionUser.Dispose();
                MentionUser = null;
            }

            if (PickImage != null)
            {
                PickImage.Dispose();
                PickImage = null;
            }

            if (TakeImage != null)
            {
                TakeImage.Dispose();
                TakeImage = null;
            }
        }
Example #40
0
 public ImageCollection FetchByID(object ImageId)
 {
     ImageCollection coll = new ImageCollection().Where("ImageId", ImageId).Load();
     return coll;
 }
Example #41
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CounterManager));
     this.lstToolBar           = new System.Windows.Forms.ImageList(this.components);
     this.tv                   = new Osherove.PerfPlus.Controls.CounterTree();
     this.barManager1          = new DevExpress.XtraBars.BarManager(this.components);
     this.bar1                 = new DevExpress.XtraBars.Bar();
     this.barButtonItem4       = new DevExpress.XtraBars.BarButtonItem();
     this.barButtonItem2       = new DevExpress.XtraBars.BarButtonItem();
     this.barButtonItem1       = new DevExpress.XtraBars.BarButtonItem();
     this.barButtonItem3       = new DevExpress.XtraBars.BarButtonItem();
     this.barButtonItem6       = new DevExpress.XtraBars.BarButtonItem();
     this.barDockControlTop    = new DevExpress.XtraBars.BarDockControl();
     this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl();
     this.barDockControlLeft   = new DevExpress.XtraBars.BarDockControl();
     this.barDockControlRight  = new DevExpress.XtraBars.BarDockControl();
     this.imageCollection1     = new DevExpress.Utils.ImageCollection(this.components);
     this.barSubItem1          = new DevExpress.XtraBars.BarSubItem();
     ((System.ComponentModel.ISupportInitialize)(this.barManager1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.imageCollection1)).BeginInit();
     this.SuspendLayout();
     //
     // lstToolBar
     //
     this.lstToolBar.ImageSize        = new System.Drawing.Size(16, 16);
     this.lstToolBar.TransparentColor = System.Drawing.Color.Magenta;
     //
     // tv
     //
     this.tv.ActivateNewTabCallback = null;
     this.tv.BackColor    = System.Drawing.Color.Gainsboro;
     this.tv.Dock         = System.Windows.Forms.DockStyle.Fill;
     this.tv.FocusManager = null;
     this.tv.LabelEdit    = true;
     this.tv.Location     = new System.Drawing.Point(0, 22);
     this.tv.MasterFolder = null;
     this.tv.Name         = "tv";
     this.tv.Size         = new System.Drawing.Size(352, 298);
     this.tv.SysMonHelper = null;
     this.tv.TabIndex     = 1;
     //
     // barManager1
     //
     this.barManager1.Bars.AddRange(new DevExpress.XtraBars.Bar[] {
         this.bar1
     });
     this.barManager1.DockControls.Add(this.barDockControlTop);
     this.barManager1.DockControls.Add(this.barDockControlBottom);
     this.barManager1.DockControls.Add(this.barDockControlLeft);
     this.barManager1.DockControls.Add(this.barDockControlRight);
     this.barManager1.Form   = this;
     this.barManager1.Images = this.imageCollection1;
     this.barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
         this.barSubItem1,
         this.barButtonItem1,
         this.barButtonItem2,
         this.barButtonItem3,
         this.barButtonItem4,
         this.barButtonItem6
     });
     this.barManager1.MaxItemId = 7;
     //
     // bar1
     //
     this.bar1.BarName       = "barActions";
     this.bar1.DockCol       = 0;
     this.bar1.DockRow       = 0;
     this.bar1.DockStyle     = DevExpress.XtraBars.BarDockStyle.Top;
     this.bar1.FloatLocation = new System.Drawing.Point(229, 161);
     this.bar1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
         new DevExpress.XtraBars.LinkPersistInfo(DevExpress.XtraBars.BarLinkUserDefines.PaintStyle, this.barButtonItem4, DevExpress.XtraBars.BarItemPaintStyle.Standard),
         new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem2),
         new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem1),
         new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem3),
         new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem6)
     });
     this.bar1.OptionsBar.AllowDelete             = true;
     this.bar1.OptionsBar.AllowQuickCustomization = false;
     this.bar1.OptionsBar.DisableClose            = true;
     this.bar1.OptionsBar.DisableCustomization    = true;
     this.bar1.OptionsBar.DrawDragBorder          = false;
     this.bar1.OptionsBar.UseWholeRow             = true;
     this.bar1.Text = "Actions";
     //
     // barButtonItem4
     //
     this.barButtonItem4.Caption    = "&Delete Folder";
     this.barButtonItem4.Id         = 4;
     this.barButtonItem4.ImageIndex = 1;
     this.barButtonItem4.Name       = "barButtonItem4";
     //
     // barButtonItem2
     //
     this.barButtonItem2.Caption    = "Create &Sub Folder";
     this.barButtonItem2.Id         = 2;
     this.barButtonItem2.ImageIndex = 2;
     this.barButtonItem2.Name       = "barButtonItem2";
     //
     // barButtonItem1
     //
     this.barButtonItem1.Caption    = "Create &Root Folder";
     this.barButtonItem1.Id         = 1;
     this.barButtonItem1.ImageIndex = 0;
     this.barButtonItem1.Name       = "barButtonItem1";
     //
     // barButtonItem3
     //
     this.barButtonItem3.Caption = "-";
     this.barButtonItem3.Id      = 3;
     this.barButtonItem3.Name    = "barButtonItem3";
     //
     // barButtonItem6
     //
     this.barButtonItem6.Caption    = "&Read counters from active monitor";
     this.barButtonItem6.Id         = 6;
     this.barButtonItem6.ImageIndex = 3;
     this.barButtonItem6.Name       = "barButtonItem6";
     //
     // imageCollection1
     //
     this.imageCollection1.ImageStream = ((DevExpress.Utils.ImageCollectionStreamer)(resources.GetObject("imageCollection1.ImageStream")));
     //
     // barSubItem1
     //
     this.barSubItem1.Caption = "&Predefined Counters";
     this.barSubItem1.Id      = 0;
     this.barSubItem1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
         new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem1),
         new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem2),
         new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem3),
         new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem4),
         new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem6)
     });
     this.barSubItem1.Name = "barSubItem1";
     //
     // CounterManager
     //
     this.Controls.Add(this.tv);
     this.Controls.Add(this.barDockControlTop);
     this.Controls.Add(this.barDockControlBottom);
     this.Controls.Add(this.barDockControlLeft);
     this.Controls.Add(this.barDockControlRight);
     this.Name = "CounterManager";
     this.Size = new System.Drawing.Size(352, 320);
     ((System.ComponentModel.ISupportInitialize)(this.barManager1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.imageCollection1)).EndInit();
     this.ResumeLayout(false);
 }
Example #42
0
		/// <summary>
		/// Initializes the adapter.
		/// </summary>
		/// <param name="window">The main form.</param>
		/// <param name="smallImages">Collection of small images.</param>
		/// <param name="largeImages">Collection of large images.</param>
		/// <param name="mediator">XCore Mediator.</param>
		/// <returns>A Control for use by client.</returns>
		public virtual System.Windows.Forms.Control Init(System.Windows.Forms.Form window,
			ImageCollection smallImages, ImageCollection largeImages, Mediator mediator)
		{
			m_window = window;
			m_smallImages = smallImages;
			m_largeImages = largeImages;
			m_mediator = mediator;
			if(this is IxCoreColleague)
				((IxCoreColleague)this).Init(mediator, null/*I suppose we could get these to the adapter if someone needs that someday*/);
			return MyControl;
		}
Example #43
0
        public void Activate()
        {
            Task taskDeleteOldCollection             = null;
            Task taskGatherExistentSpecies           = null;
            Dictionary <string, int> existentSpecies = new Dictionary <string, int>();

            ImageCollection arkiveCollection = TaxonImages.Manager.GetByName("Arkive");

            if (arkiveCollection != null)
            {
                QuestionDialog dlg = new QuestionDialog
                                     (
                    "Arkive collection already exists !\nWhat do you want to do ?",
                    "Confirm ... ",
                    new TaxonDialog.AnswersDesc().
                    Add("Delete", "delete all content of old arkive collection", 0).
                    Add("Merge", "import only image for species newly found", 1).
                    Add("Cancel", "stop the generation of collection", 2)
                                     );
                dlg.ShowDialog();
                OneAnswerDesc answer = dlg.Answer;

                if (answer == null || answer.ID == 2)
                {
                    return;
                }

                /*string message = "Arkive collection exist, remove it ?";
                 * DialogResult result = MessageBox.Show(message, "Confirm ...", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                 * if (result == DialogResult.Cancel)
                 *  return;*/

                if (answer.ID == 0)
                {
                    taskDeleteOldCollection = Task.Factory.StartNew(() => Directory.Delete(arkiveCollection.Path, true));
                }
                else
                {
                    taskGatherExistentSpecies = Task.Factory.StartNew(() =>
                    {
                        foreach (string file in Directory.EnumerateFiles(arkiveCollection.Path))
                        {
                            string species = Path.GetFileNameWithoutExtension(file).Split('_')[0];
                            if (!existentSpecies.ContainsKey(species))
                            {
                                existentSpecies[species] = 0;
                            }
                            existentSpecies[species] = existentSpecies[species] + 1;
                        }
                    });
                }
            }

            string folderArkive;

            using (var fbd = new FolderBrowserDialog())
            {
                fbd.Description  = "Select Folder where Arkive images are stored";
                fbd.SelectedPath = TaxonUtils.GetTaxonPath();
                DialogResult result = fbd.ShowDialog();
                if (result != DialogResult.OK || string.IsNullOrWhiteSpace(fbd.SelectedPath))
                {
                    return;
                }
                folderArkive = fbd.SelectedPath;
            }

            int lengthFolderArkive = folderArkive.Length;

            using (ProgressDialog progressDlg = new ProgressDialog())
            {
                progressDlg.StartPosition = FormStartPosition.CenterScreen;
                progressDlg.Show();

                ProgressItem piInitSearch = progressDlg.Add("Initialize searching", "", 0, 2);
                TaxonSearch  searching    = new TaxonSearch(TaxonUtils.OriginalRoot, true, true);
                piInitSearch.Update(1);
                string[] foldersLevel1 = Directory.GetDirectories(folderArkive);
                piInitSearch.Update(2);
                piInitSearch.End();

                Dictionary <string, string>        unknownFolder = new Dictionary <string, string>();
                Dictionary <string, TaxonTreeNode> knownFolder   = new Dictionary <string, TaxonTreeNode>();
                int missedPhotos          = 0;
                int importedPhotos        = 0;
                int alreadyImportedPhotos = 0;
                int newlyImportedPhotos   = 0;

                ProgressItem piParse = progressDlg.Add("Parse arkive folders", "", 0, foldersLevel1.Length);
                for (uint i = 0; i < foldersLevel1.Length; i++)
                {
                    piParse.Update(i, foldersLevel1[i].Substring(lengthFolderArkive + 1));
                    int folder1Length = foldersLevel1[i].Length + 1;

                    string[] foldersLevel2 = Directory.GetDirectories(foldersLevel1[i]);
                    foreach (string folder2 in foldersLevel2)
                    {
                        //if (folder2.ToLower().Contains("acropora"))
                        //    Console.WriteLine(folder2);

                        string[] photos = Directory.GetFiles(folder2, "*.jpg");
                        if (photos.Length == 0)
                        {
                            continue;
                        }

                        string        name = folder2.Substring(folder1Length).Replace('-', ' ').ToLower().Trim();
                        TaxonTreeNode node = searching.FindOne(name);
                        if (node == null)
                        {
                            unknownFolder[folder2] = name;
                            missedPhotos          += photos.Length;
                        }
                        else
                        {
                            knownFolder[folder2] = node;
                        }
                    }
                }
                piParse.Update(piParse.Max, knownFolder.Count.ToString() + " found, " + unknownFolder.Count.ToString() + " not.");

                if (taskDeleteOldCollection != null && !taskDeleteOldCollection.IsCompleted)
                {
                    ProgressItem piClean = progressDlg.Add("Clean old collection", "", 0, 1);
                    taskDeleteOldCollection.Wait();
                    piClean.Update(1);
                    piClean.End();
                }

                if (taskGatherExistentSpecies != null && !taskGatherExistentSpecies.IsCompleted)
                {
                    ProgressItem piAnalyseOld = progressDlg.Add("Analyse old collection", "", 0, 1);
                    taskGatherExistentSpecies.Wait();
                    piAnalyseOld.Update(1);
                    piAnalyseOld.End();
                }

                arkiveCollection = TaxonImages.Manager.GetOrCreateCollection("Arkive");
                if (arkiveCollection == null)
                {
                    return;
                }
                arkiveCollection.Desc  = "Collection generated from images taken from Arkive site : http://www.arkive.org";
                arkiveCollection.Desc += "Generated date : " + DateTime.Now.ToString();
                arkiveCollection.SaveInfos();
                ProgressItem piPopulate = progressDlg.Add("Populate collection", "", 0, knownFolder.Count);
                foreach (KeyValuePair <string, TaxonTreeNode> pair in knownFolder)
                {
                    string speciesName = pair.Value.Desc.RefMultiName.Main;
                    piPopulate.Update(piPopulate.Current + 1, speciesName);

                    string[] photos = Directory.GetFiles(pair.Key, "*.jpg");
                    importedPhotos += photos.Length;

                    if (existentSpecies.ContainsKey(speciesName))
                    {
                        if (existentSpecies[speciesName] == photos.Length)
                        {
                            alreadyImportedPhotos += photos.Length;
                            continue;
                        }
                        File.Delete(arkiveCollection.Path + Path.DirectorySeparatorChar + speciesName + "*.*");
                    }

                    newlyImportedPhotos += photos.Length;

                    for (int index = 0; index < photos.Length; index++)
                    {
                        string newName = speciesName + "_" + index.ToString() + ".jpg";
                        File.Copy(photos[index], arkiveCollection.Path + Path.DirectorySeparatorChar + newName);
                    }
                }
                piPopulate.Update(piPopulate.Max, importedPhotos.ToString() + " photos imported.");

                string message0 = (unknownFolder.Count + knownFolder.Count).ToString() + " total folders found\n";
                string message1 = knownFolder.Count.ToString() + " with associated taxons ( " + importedPhotos.ToString() + " photos imported )";
                if (newlyImportedPhotos != importedPhotos)
                {
                    message1 += " ( merging : " + newlyImportedPhotos + " new photos";
                }
                string message2 = unknownFolder.Count.ToString() + " names not found ( " + missedPhotos.ToString() + " photos left behind )";
                string message  = message0 + "\n" + message1 + "\n" + message2 + "\n\n" + "for more details, look at GenerateArkiveCollection.log file";
                if (unknownFolder.Count > 0)
                {
                    message += "\nA list of taxons is generated with all name not found : " + Path.Combine(TaxonList.GetFolder(), "ArkiveNames.txt");
                }
                Loggers.WriteInformation(LogTags.Data, message);

                try
                {
                    List <KeyValuePair <string, string> > unknowns = unknownFolder.ToList();
                    unknowns.Sort((x, y) => x.Value.CompareTo(y.Value));

                    string file = Path.Combine(TaxonUtils.GetLogPath(), "GenerateArkiveCollection.log");
                    if (File.Exists(file))
                    {
                        File.Delete(file);
                    }
                    using (StreamWriter outfile = new StreamWriter(file))
                    {
                        outfile.WriteLine("GenerateArkiveCollection results:");
                        outfile.WriteLine();
                        outfile.WriteLine("  " + message0);
                        outfile.WriteLine("  " + message1);
                        outfile.WriteLine("  " + message2);
                        outfile.WriteLine();
                        if (unknowns.Count > 0)
                        {
                            outfile.WriteLine("List of not found names:");
                            outfile.WriteLine();

                            int maxLength = 0;
                            foreach (KeyValuePair <string, string> pair in unknowns)
                            {
                                maxLength = Math.Max(maxLength, pair.Value.Length);
                            }
                            foreach (KeyValuePair <string, string> pair in unknowns)
                            {
                                outfile.WriteLine("  " + pair.Value.PadRight(maxLength) + " => " + pair.Key);
                            }
                            outfile.WriteLine();
                        }
                    }

                    if (unknowns.Count > 0)
                    {
                        file = Path.Combine(TaxonList.GetFolder(), "ArkiveNames.txt");
                        if (File.Exists(file))
                        {
                            File.Delete(file);
                        }
                        using (StreamWriter outfile = new StreamWriter(file))
                        {
                            foreach (KeyValuePair <string, string> pair in unknowns)
                            {
                                outfile.WriteLine(pair.Value);
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    string error = "Exception while saving results in GenerateArkiveCollection.log: \n\n";
                    error += e.Message;
                    if (e.InnerException != null)
                    {
                        error += "\n" + e.InnerException.Message;
                    }
                    Loggers.WriteError(LogTags.Data, error);
                }
            }
        }
Example #44
0
 public ImageItem(Leadtools.RasterImage rasterImage, ImageCollection parent)
 {
     _rasterImage = rasterImage;
     _tag         = null;
     _parent      = parent;
 }
Example #45
0
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     DevExpress.Utils.SuperToolTip     superToolTip1          = new DevExpress.Utils.SuperToolTip();
     DevExpress.Utils.ToolTipTitleItem toolTipTitleItem1      = new DevExpress.Utils.ToolTipTitleItem();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(xfmDictionary));
     this.navBarControl1    = new DevExpress.XtraNavBar.NavBarControl();
     this.navEmployee       = new DevExpress.XtraNavBar.NavBarGroup();
     this.bbiPosition       = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiDIC_Hospital   = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiDegree         = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiJob            = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiPatientObject  = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiEthnic         = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiDoiTuongBHYT   = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiRelative       = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiEducation      = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiSpecialty      = new DevExpress.XtraNavBar.NavBarItem();
     this.ppiDIC_Province   = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiDIC_Huyen      = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiDIC_XaPhuong   = new DevExpress.XtraNavBar.NavBarItem();
     this.navOrganization   = new DevExpress.XtraNavBar.NavBarGroup();
     this.bbiSubsidiary     = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiBranch         = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiDepartment     = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiGroup          = new DevExpress.XtraNavBar.NavBarItem();
     this.navTimekeeping    = new DevExpress.XtraNavBar.NavBarGroup();
     this.bbiShift          = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiSymbol         = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiMachine        = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiHoliday        = new DevExpress.XtraNavBar.NavBarItem();
     this.navBarItem1       = new DevExpress.XtraNavBar.NavBarItem();
     this.navBarItem2       = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiRank           = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiStep           = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiAllowance      = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiRate           = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiGroupRate      = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiUnit           = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiProductGroup   = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiProduct        = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiState          = new DevExpress.XtraNavBar.NavBarItem();
     this.bbiSalaryIncome   = new DevExpress.XtraNavBar.NavBarItem();
     this.imageCollection1  = new DevExpress.Utils.ImageCollection(this.components);
     this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.tsmiOpenNewTab    = new System.Windows.Forms.ToolStripMenuItem();
     this.tsmiThuNho        = new System.Windows.Forms.ToolStripMenuItem();
     this.gcControl         = new DevExpress.XtraEditors.GroupControl();
     this.navBarItem3       = new DevExpress.XtraNavBar.NavBarItem();
     ((System.ComponentModel.ISupportInitialize)(this.navBarControl1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.imageCollection1)).BeginInit();
     this.contextMenuStrip1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.gcControl)).BeginInit();
     this.SuspendLayout();
     //
     // navBarControl1
     //
     this.navBarControl1.ActiveGroup       = this.navEmployee;
     this.navBarControl1.ContentButtonHint = null;
     this.navBarControl1.Dock          = System.Windows.Forms.DockStyle.Left;
     this.navBarControl1.DragDropFlags = ((DevExpress.XtraNavBar.NavBarDragDrop)((((DevExpress.XtraNavBar.NavBarDragDrop.Default | DevExpress.XtraNavBar.NavBarDragDrop.AllowDrag)
                                                                                   | DevExpress.XtraNavBar.NavBarDragDrop.AllowDrop)
                                                                                  | DevExpress.XtraNavBar.NavBarDragDrop.AllowOuterDrop)));
     this.navBarControl1.Groups.AddRange(new DevExpress.XtraNavBar.NavBarGroup[] {
         this.navEmployee,
         this.navOrganization,
         this.navTimekeeping
     });
     this.navBarControl1.Items.AddRange(new DevExpress.XtraNavBar.NavBarItem[] {
         this.bbiPosition,
         this.bbiDIC_Hospital,
         this.bbiEthnic,
         this.bbiEducation,
         this.bbiPatientObject,
         this.bbiDoiTuongBHYT,
         this.bbiJob,
         this.bbiShift,
         this.bbiDegree,
         this.bbiRelative,
         this.bbiRank,
         this.bbiStep,
         this.bbiBranch,
         this.bbiDepartment,
         this.bbiGroup,
         this.bbiAllowance,
         this.bbiSymbol,
         this.bbiMachine,
         this.bbiRate,
         this.bbiGroupRate,
         this.bbiUnit,
         this.bbiProductGroup,
         this.bbiProduct,
         this.bbiState,
         this.bbiHoliday,
         this.bbiSubsidiary,
         this.bbiSalaryIncome,
         this.navBarItem1,
         this.navBarItem2,
         this.bbiSpecialty,
         this.ppiDIC_Province,
         this.bbiDIC_Huyen,
         this.bbiDIC_XaPhuong
     });
     this.navBarControl1.Location = new System.Drawing.Point(0, 0);
     this.navBarControl1.Name     = "navBarControl1";
     this.navBarControl1.NavigationPaneMaxVisibleGroups = 5;
     this.navBarControl1.OptionsNavPane.ExpandedWidth   = 190;
     this.navBarControl1.Size        = new System.Drawing.Size(190, 628);
     this.navBarControl1.SmallImages = this.imageCollection1;
     this.navBarControl1.TabIndex    = 3;
     this.navBarControl1.Text        = "navBarControl1";
     this.navBarControl1.View        = new DevExpress.XtraNavBar.ViewInfo.SkinNavigationPaneViewInfoRegistrator();
     this.navBarControl1.MouseDown  += new System.Windows.Forms.MouseEventHandler(this.navBarControl1_MouseDown);
     //
     // navEmployee
     //
     this.navEmployee.Caption  = "Danh Mục Hành Chính";
     this.navEmployee.Expanded = true;
     this.navEmployee.ImageOptions.LargeImageIndex = 0;
     this.navEmployee.ImageOptions.LargeImageSize  = new System.Drawing.Size(32, 32);
     this.navEmployee.ImageOptions.SmallImageIndex = 0;
     this.navEmployee.ItemLinks.AddRange(new DevExpress.XtraNavBar.NavBarItemLink[] {
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiPosition),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiDIC_Hospital),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiDegree),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiJob),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiPatientObject),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiEthnic),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiDoiTuongBHYT),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiRelative),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiEducation),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiSpecialty),
         new DevExpress.XtraNavBar.NavBarItemLink(this.ppiDIC_Province),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiDIC_Huyen),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiDIC_XaPhuong)
     });
     this.navEmployee.Name = "navEmployee";
     this.navEmployee.TopVisibleLinkIndex = 1;
     //
     // bbiPosition
     //
     this.bbiPosition.Caption = "Cán Bộ";
     this.bbiPosition.ImageOptions.LargeImageIndex = 3;
     this.bbiPosition.ImageOptions.SmallImageIndex = 3;
     this.bbiPosition.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiPosition.Name         = "bbiPosition";
     this.bbiPosition.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiPosition_LinkClicked);
     //
     // bbiDIC_Hospital
     //
     this.bbiDIC_Hospital.Caption = "Bệnh Viện";
     this.bbiDIC_Hospital.ImageOptions.SmallImageIndex = 3;
     this.bbiDIC_Hospital.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiDIC_Hospital.Name         = "bbiDIC_Hospital";
     this.bbiDIC_Hospital.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiDIC_Hospital_LinkClicked);
     //
     // bbiDegree
     //
     this.bbiDegree.Caption = "Phòng ban";
     this.bbiDegree.ImageOptions.SmallImageIndex = 3;
     this.bbiDegree.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiDegree.Name         = "bbiDegree";
     this.bbiDegree.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiDegree_LinkClicked);
     //
     // bbiJob
     //
     this.bbiJob.Caption = "Nghề Nghiệp";
     this.bbiJob.ImageOptions.SmallImageIndex = 3;
     this.bbiJob.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiJob.Name         = "bbiJob";
     this.bbiJob.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiJob_LinkClicked);
     //
     // bbiPatientObject
     //
     this.bbiPatientObject.Caption = "Đối Tượng Bệnh Nhân";
     this.bbiPatientObject.ImageOptions.SmallImageIndex = 3;
     this.bbiPatientObject.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiPatientObject.Name         = "bbiPatientObject";
     this.bbiPatientObject.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiPatientObject_LinkClicked);
     //
     // bbiEthnic
     //
     this.bbiEthnic.Caption = "Dân Tộc";
     this.bbiEthnic.ImageOptions.SmallImageIndex = 3;
     this.bbiEthnic.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiEthnic.Name         = "bbiEthnic";
     this.bbiEthnic.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiEthnic_LinkClicked);
     //
     // bbiDoiTuongBHYT
     //
     this.bbiDoiTuongBHYT.Caption = "Đối Tượng Bảo Hiểm";
     this.bbiDoiTuongBHYT.ImageOptions.SmallImageIndex = 3;
     this.bbiDoiTuongBHYT.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiDoiTuongBHYT.Name         = "bbiDoiTuongBHYT";
     this.bbiDoiTuongBHYT.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiDoiTuongBHYT_LinkClicked);
     //
     // bbiRelative
     //
     this.bbiRelative.Caption = "Mã ICD";
     this.bbiRelative.ImageOptions.SmallImageIndex = 3;
     this.bbiRelative.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiRelative.Name         = "bbiRelative";
     this.bbiRelative.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiRelative_LinkClicked);
     //
     // bbiEducation
     //
     this.bbiEducation.Caption = "Danh Sách Thẻ Hết Hạn";
     this.bbiEducation.ImageOptions.SmallImageIndex = 3;
     this.bbiEducation.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiEducation.Name         = "bbiEducation";
     this.bbiEducation.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiEducation_LinkClicked);
     //
     // bbiSpecialty
     //
     this.bbiSpecialty.Caption = "Chuyên Khoa";
     this.bbiSpecialty.ImageOptions.SmallImageIndex = 3;
     this.bbiSpecialty.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiSpecialty.Name         = "bbiSpecialty";
     this.bbiSpecialty.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiSpecialty_LinkClicked);
     //
     // ppiDIC_Province
     //
     this.ppiDIC_Province.Caption = "Tỉnh/Thành";
     this.ppiDIC_Province.ImageOptions.SmallImageIndex = 3;
     this.ppiDIC_Province.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.ppiDIC_Province.Name = "ppiDIC_Province";
     toolTipTitleItem1.Text    = "Danh Mục Tỉnh Thành";
     superToolTip1.Items.Add(toolTipTitleItem1);
     this.ppiDIC_Province.SuperTip     = superToolTip1;
     this.ppiDIC_Province.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.ppiDIC_Province_LinkClicked);
     //
     // bbiDIC_Huyen
     //
     this.bbiDIC_Huyen.Caption = "Huyện/Thị Xã";
     this.bbiDIC_Huyen.ImageOptions.SmallImageIndex = 3;
     this.bbiDIC_Huyen.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiDIC_Huyen.Name         = "bbiDIC_Huyen";
     this.bbiDIC_Huyen.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiDIC_Huyen_LinkClicked);
     //
     // bbiDIC_XaPhuong
     //
     this.bbiDIC_XaPhuong.Caption = "Xã/Phường";
     this.bbiDIC_XaPhuong.ImageOptions.SmallImageIndex = 3;
     this.bbiDIC_XaPhuong.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiDIC_XaPhuong.Name         = "bbiDIC_XaPhuong";
     this.bbiDIC_XaPhuong.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiDIC_XaPhuong_LinkClicked);
     //
     // navOrganization
     //
     this.navOrganization.Caption = "Nhóm Dược";
     this.navOrganization.ImageOptions.LargeImageIndex = 1;
     this.navOrganization.ImageOptions.SmallImageIndex = 2;
     this.navOrganization.ItemLinks.AddRange(new DevExpress.XtraNavBar.NavBarItemLink[] {
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiSubsidiary),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiBranch),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiDepartment),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiGroup)
     });
     this.navOrganization.Name = "navOrganization";
     //
     // bbiSubsidiary
     //
     this.bbiSubsidiary.Caption = "Dược";
     this.bbiSubsidiary.ImageOptions.SmallImageIndex = 4;
     this.bbiSubsidiary.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiSubsidiary.Name         = "bbiSubsidiary";
     this.bbiSubsidiary.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiSubsidiary_LinkClicked);
     //
     // bbiBranch
     //
     this.bbiBranch.Caption = "Nhà Cung Cấp";
     this.bbiBranch.ImageOptions.SmallImageIndex = 4;
     this.bbiBranch.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiBranch.Name         = "bbiBranch";
     this.bbiBranch.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiBranch_LinkClicked);
     //
     // bbiDepartment
     //
     this.bbiDepartment.Caption = "Giá Thuốc Ưu Tiên";
     this.bbiDepartment.ImageOptions.SmallImageIndex = 4;
     this.bbiDepartment.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiDepartment.Name         = "bbiDepartment";
     this.bbiDepartment.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiDepartment_LinkClicked);
     //
     // bbiGroup
     //
     this.bbiGroup.Caption = "Đơn Thuốc Mẫu";
     this.bbiGroup.ImageOptions.SmallImageIndex = 4;
     this.bbiGroup.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiGroup.Name         = "bbiGroup";
     this.bbiGroup.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiGroup_LinkClicked);
     //
     // navTimekeeping
     //
     this.navTimekeeping.Caption = "Nhóm Dịch Vụ";
     this.navTimekeeping.ImageOptions.LargeImageIndex = 2;
     this.navTimekeeping.ImageOptions.SmallImageIndex = 1;
     this.navTimekeeping.ItemLinks.AddRange(new DevExpress.XtraNavBar.NavBarItemLink[] {
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiShift),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiSymbol),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiMachine),
         new DevExpress.XtraNavBar.NavBarItemLink(this.bbiHoliday),
         new DevExpress.XtraNavBar.NavBarItemLink(this.navBarItem1),
         new DevExpress.XtraNavBar.NavBarItemLink(this.navBarItem2)
     });
     this.navTimekeeping.Name = "navTimekeeping";
     //
     // bbiShift
     //
     this.bbiShift.Caption = "Dịch Vụ";
     this.bbiShift.ImageOptions.SmallImageIndex = 5;
     this.bbiShift.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiShift.Name         = "bbiShift";
     this.bbiShift.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiShift_LinkClicked);
     //
     // bbiSymbol
     //
     this.bbiSymbol.Caption = "Nhóm Dịch Vụ";
     this.bbiSymbol.ImageOptions.SmallImageIndex = 5;
     this.bbiSymbol.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiSymbol.Name         = "bbiSymbol";
     this.bbiSymbol.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiSymbol_LinkClicked);
     //
     // bbiMachine
     //
     this.bbiMachine.Caption = "Tiểu Nhóm Dịch Vụ";
     this.bbiMachine.ImageOptions.SmallImageIndex = 5;
     this.bbiMachine.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiMachine.Name         = "bbiMachine";
     this.bbiMachine.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiMachine_LinkClicked);
     //
     // bbiHoliday
     //
     this.bbiHoliday.Caption = "Kết Quả Mẫu";
     this.bbiHoliday.ImageOptions.SmallImageIndex = 5;
     this.bbiHoliday.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.bbiHoliday.Name         = "bbiHoliday";
     this.bbiHoliday.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiHoliday_LinkClicked);
     //
     // navBarItem1
     //
     this.navBarItem1.Caption = "Dịch Vụ Chi Tiết";
     this.navBarItem1.ImageOptions.SmallImageIndex = 5;
     this.navBarItem1.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.navBarItem1.Name = "navBarItem1";
     //
     // navBarItem2
     //
     this.navBarItem2.Caption = "Biên Lai";
     this.navBarItem2.ImageOptions.SmallImageIndex = 5;
     this.navBarItem2.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.navBarItem2.Name = "navBarItem2";
     //
     // bbiRank
     //
     this.bbiRank.Caption = "Ngạch Lương";
     this.bbiRank.ImageOptions.LargeImageIndex = 66;
     this.bbiRank.ImageOptions.SmallImageIndex = 23;
     this.bbiRank.Name         = "bbiRank";
     this.bbiRank.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiRank_LinkClicked);
     //
     // bbiStep
     //
     this.bbiStep.Caption = "Bậc Lương";
     this.bbiStep.ImageOptions.LargeImageIndex = 67;
     this.bbiStep.ImageOptions.SmallImageIndex = 24;
     this.bbiStep.Name         = "bbiStep";
     this.bbiStep.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiStep_LinkClicked);
     //
     // bbiAllowance
     //
     this.bbiAllowance.Caption = "Phụ Cấp";
     this.bbiAllowance.ImageOptions.SmallImageIndex = 25;
     this.bbiAllowance.Name         = "bbiAllowance";
     this.bbiAllowance.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiAllowance_LinkClicked);
     //
     // bbiRate
     //
     this.bbiRate.Caption = "Tiêu Chí Đánh Giá";
     this.bbiRate.ImageOptions.SmallImageIndex = 14;
     this.bbiRate.Name         = "bbiRate";
     this.bbiRate.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiRate_LinkClicked);
     //
     // bbiGroupRate
     //
     this.bbiGroupRate.Caption = "Nhóm Tiêu Chí";
     this.bbiGroupRate.ImageOptions.SmallImageIndex = 14;
     this.bbiGroupRate.Name         = "bbiGroupRate";
     this.bbiGroupRate.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiGroupRate_LinkClicked);
     //
     // bbiUnit
     //
     this.bbiUnit.Caption = "Đơn Vị Tính";
     this.bbiUnit.ImageOptions.SmallImageIndex = 29;
     this.bbiUnit.Name         = "bbiUnit";
     this.bbiUnit.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiUnit_LinkClicked);
     //
     // bbiProductGroup
     //
     this.bbiProductGroup.Caption = "Nhóm Sản Phẩm";
     this.bbiProductGroup.ImageOptions.SmallImageIndex = 30;
     this.bbiProductGroup.Name         = "bbiProductGroup";
     this.bbiProductGroup.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiProductGroup_LinkClicked);
     //
     // bbiProduct
     //
     this.bbiProduct.Caption = "Sản Phẩm";
     this.bbiProduct.ImageOptions.SmallImageIndex = 31;
     this.bbiProduct.Name         = "bbiProduct";
     this.bbiProduct.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiProduct_LinkClicked);
     //
     // bbiState
     //
     this.bbiState.Caption = "Công Đoạn Sản Xuất";
     this.bbiState.ImageOptions.SmallImageIndex = 32;
     this.bbiState.Name         = "bbiState";
     this.bbiState.LinkClicked += new DevExpress.XtraNavBar.NavBarLinkEventHandler(this.bbiState_LinkClicked);
     //
     // bbiSalaryIncome
     //
     this.bbiSalaryIncome.Caption = "bbiSalaryIncome";
     this.bbiSalaryIncome.Name    = "bbiSalaryIncome";
     //
     // imageCollection1
     //
     this.imageCollection1.ImageSize   = new System.Drawing.Size(32, 32);
     this.imageCollection1.ImageStream = ((DevExpress.Utils.ImageCollectionStreamer)(resources.GetObject("imageCollection1.ImageStream")));
     this.imageCollection1.InsertImage(global::Vssoft.Dictionary.Properties.Resource.hanh_chinh_32, "hanh_chinh_32", typeof(global::Vssoft.Dictionary.Properties.Resource), 0);
     this.imageCollection1.Images.SetKeyName(0, "hanh_chinh_32");
     this.imageCollection1.InsertImage(global::Vssoft.Dictionary.Properties.Resource.medical_test_stethoscope_32, "medical_test_stethoscope_32", typeof(global::Vssoft.Dictionary.Properties.Resource), 1);
     this.imageCollection1.Images.SetKeyName(1, "medical_test_stethoscope_32");
     this.imageCollection1.InsertImage(global::Vssoft.Dictionary.Properties.Resource.pill_drugs_32, "pill_drugs_32", typeof(global::Vssoft.Dictionary.Properties.Resource), 2);
     this.imageCollection1.Images.SetKeyName(2, "pill_drugs_32");
     this.imageCollection1.InsertGalleryImage("bofileattachment_32x32.png", "images/business%20objects/bofileattachment_32x32.png", DevExpress.Images.ImageResourceCache.Default.GetImage("images/business%20objects/bofileattachment_32x32.png"), 3);
     this.imageCollection1.Images.SetKeyName(3, "bofileattachment_32x32.png");
     this.imageCollection1.InsertGalleryImage("boreport_32x32.png", "images/business%20objects/boreport_32x32.png", DevExpress.Images.ImageResourceCache.Default.GetImage("images/business%20objects/boreport_32x32.png"), 4);
     this.imageCollection1.Images.SetKeyName(4, "boreport_32x32.png");
     this.imageCollection1.InsertGalleryImage("bosale_32x32.png", "images/business%20objects/bosale_32x32.png", DevExpress.Images.ImageResourceCache.Default.GetImage("images/business%20objects/bosale_32x32.png"), 5);
     this.imageCollection1.Images.SetKeyName(5, "bosale_32x32.png");
     //
     // contextMenuStrip1
     //
     this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.tsmiOpenNewTab,
         this.tsmiThuNho
     });
     this.contextMenuStrip1.Name     = "contextMenuStrip1";
     this.contextMenuStrip1.Size     = new System.Drawing.Size(180, 48);
     this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
     //
     // tsmiOpenNewTab
     //
     this.tsmiOpenNewTab.Name   = "tsmiOpenNewTab";
     this.tsmiOpenNewTab.Size   = new System.Drawing.Size(179, 22);
     this.tsmiOpenNewTab.Text   = "Mở trong trang mới";
     this.tsmiOpenNewTab.Click += new System.EventHandler(this.tsmiOpenNewTab_Click);
     //
     // tsmiThuNho
     //
     this.tsmiThuNho.Name   = "tsmiThuNho";
     this.tsmiThuNho.Size   = new System.Drawing.Size(179, 22);
     this.tsmiThuNho.Text   = "Thu nhỏ";
     this.tsmiThuNho.Click += new System.EventHandler(this.tsmiThuNho_Click);
     //
     // gcControl
     //
     this.gcControl.AppearanceCaption.Font            = new System.Drawing.Font("Tahoma", 11F);
     this.gcControl.AppearanceCaption.Options.UseFont = true;
     this.gcControl.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.gcControl.Location = new System.Drawing.Point(190, 0);
     this.gcControl.Name     = "gcControl";
     this.gcControl.Size     = new System.Drawing.Size(714, 628);
     this.gcControl.TabIndex = 4;
     this.gcControl.Text     = "groupControl1";
     //
     // navBarItem3
     //
     this.navBarItem3.Caption = "Danh Sách Thẻ Hết Hạn";
     this.navBarItem3.ImageOptions.SmallImageIndex = 3;
     this.navBarItem3.ImageOptions.SmallImageSize  = new System.Drawing.Size(24, 24);
     this.navBarItem3.Name = "navBarItem3";
     //
     // xfmDictionary
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(904, 628);
     this.Controls.Add(this.gcControl);
     this.Controls.Add(this.navBarControl1);
     this.Name  = "xfmDictionary";
     this.Text  = "Quản lý danh mục";
     this.Load += new System.EventHandler(this.xfmDictionary_Load_1);
     ((System.ComponentModel.ISupportInitialize)(this.navBarControl1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.imageCollection1)).EndInit();
     this.contextMenuStrip1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.gcControl)).EndInit();
     this.ResumeLayout(false);
 }
Example #46
0
        /// <summary>
        /// (Re-)Generates all mipmap levels.
        /// </summary>
        /// <param name="filter">The filter to use for resizing.</param>
        /// <param name="alphaTransparency">
        /// <see langword="true"/> if the image contains uses non-premultiplied alpha; otherwise,
        /// <see langword="false"/> if the image uses premultiplied alpha or has no alpha.
        /// </param>
        /// <param name="wrapMode">
        /// The texture address mode that will be used for sampling the at runtime.
        /// </param>
        public void GenerateMipmaps(ResizeFilter filter, bool alphaTransparency, TextureAddressMode wrapMode)
        {
            var oldDescription = Description;
              var newDescription = Description;

              // Determine number of mipmap levels.
              if (oldDescription.Dimension == TextureDimension.Texture3D)
            newDescription.MipLevels = TextureHelper.CalculateMipLevels(oldDescription.Width, oldDescription.Height, oldDescription.Depth);
              else
            newDescription.MipLevels = TextureHelper.CalculateMipLevels(oldDescription.Width, oldDescription.Height);

              if (oldDescription.MipLevels != newDescription.MipLevels)
              {
            // Update Description and Images.
            var oldImages = Images;
            Description = newDescription;
            #if DEBUG
            ValidateTexture(newDescription);
            #endif
            // Recreate image collection. (Mipmap level 0 is copied from existing image collection.)
            Images = CreateImageCollection(newDescription, true);
            for (int arrayIndex = 0; arrayIndex < newDescription.ArraySize; arrayIndex++)
            {
              for (int zIndex = 0; zIndex < newDescription.Depth; zIndex++)
              {
            int oldIndex = oldDescription.GetImageIndex(0, arrayIndex, zIndex);
            int newIndex = newDescription.GetImageIndex(0, arrayIndex, zIndex);
            Images[newIndex] = oldImages[oldIndex];
              }
            }
              }

              // Downsample mipmap levels.
              for (int arrayIndex = 0; arrayIndex < newDescription.ArraySize; arrayIndex++)
            for (int mipIndex = 0; mipIndex < newDescription.MipLevels - 1; mipIndex++)
              TextureHelper.Resize(this, mipIndex, arrayIndex, this, mipIndex + 1, arrayIndex, filter, alphaTransparency, wrapMode);
        }
 /// <summary>
 /// Gets images for the requested movie.
 /// </summary>
 /// <param name="id">TMDB ID of movie</param>
 /// <param name="imageCollection">Returns the ImageCollection</param>
 /// <returns><c>true</c> if successful</returns>
 public bool GetMovieFanArt(int id, out ImageCollection imageCollection)
 {
     imageCollection = _movieDbHandler.GetImages(id, null); // Download all image information, filter later!
     return(imageCollection != null);
 }
Example #48
0
		public ImageList()
		{
			images = new ImageCollection(this);
		}
        private void SetSharedImageCollectionImages(ImageCollection imageCollection)
        {
            var fi = typeof(SharedImageCollection).GetField("instance", BindingFlags.Static | BindingFlags.NonPublic);

            fi?.SetValue(null, imageCollection);
        }