예제 #1
0
        // <snippet3>
        // Generate the design-time markup.
        public override string GetDesignTimeHtml()
        {
            // Make the control more visible in the designer.  If the border
            // style is None or NotSet, change the border to a dashed line.
            SampleLabel sampleLabel      = (SampleLabel)Component;
            string      designTimeMarkup = null;

            // Check if the border style should be changed.
            if (sampleLabel.BorderStyle == BorderStyle.NotSet ||
                sampleLabel.BorderStyle == BorderStyle.None)
            {
                BorderStyle oldBorderStyle = sampleLabel.BorderStyle;

                try
                {
                    // Set the design-time BorderStyle.
                    sampleLabel.BorderStyle = BorderStyle.Dashed;

                    // Call the base method to generate the markup.
                    designTimeMarkup = base.GetDesignTimeHtml();
                }
                catch (Exception ex)
                {
                    // If an exception occurs, generate an error message.
                    designTimeMarkup = GetErrorDesignTimeHtml(ex);
                }
                finally
                {
                    // Restore the BorderStyle to its original setting.
                    sampleLabel.BorderStyle = oldBorderStyle;
                }
            }
            else
            {
                // Call the base method to generate the markup.
                designTimeMarkup = base.GetDesignTimeHtml();
            }

            return(designTimeMarkup);
        } // GetDesignTimeHtml
 public void Initialize()
 {
     CabFurLabelLabelManager = new CabFurLabel();
     SampleLabelManager      = new SampleLabel();
     if (CabFurDT == null)
     {
         CabFurDT = new DataTable();
         CabFurDT.Columns.Add(new DataColumn("TechStoreName", Type.GetType("System.String")));
         CabFurDT.Columns.Add(new DataColumn("TechStoreSubGroupName", Type.GetType("System.String")));
         CabFurDT.Columns.Add(new DataColumn("SubGroupNotes", Type.GetType("System.String")));
         CabFurDT.Columns.Add(new DataColumn("SubGroupNotes1", Type.GetType("System.String")));
         CabFurDT.Columns.Add(new DataColumn("SubGroupNotes2", Type.GetType("System.String")));
         CabFurDT.Columns.Add(new DataColumn("Product", Type.GetType("System.String")));
         CabFurDT.Columns.Add(new DataColumn("Color", Type.GetType("System.String")));
         CabFurDT.Columns.Add(new DataColumn("Height", Type.GetType("System.String")));
         CabFurDT.Columns.Add(new DataColumn("Width", Type.GetType("System.String")));
         CabFurDT.Columns.Add(new DataColumn("Length", Type.GetType("System.String")));
         CabFurDT.Columns.Add(new DataColumn("PositionsCount", Type.GetType("System.String")));
         CabFurDT.Columns.Add(new DataColumn("LabelsCount", Type.GetType("System.Int32")));
         CabFurDT.Columns.Add(new DataColumn("FactoryType", Type.GetType("System.Int32")));
         CabFurDT.Columns.Add(new DataColumn("DecorConfigID", Type.GetType("System.Int32")));
     }
     if (DecorDT == null)
     {
         DecorDT = new DataTable();
         DecorDT.Columns.Add(new DataColumn("Product", Type.GetType("System.String")));
         DecorDT.Columns.Add(new DataColumn("Decor", Type.GetType("System.String")));
         DecorDT.Columns.Add(new DataColumn("Color", Type.GetType("System.String")));
         DecorDT.Columns.Add(new DataColumn("Length", Type.GetType("System.String")));
         DecorDT.Columns.Add(new DataColumn("Height", Type.GetType("System.String")));
         DecorDT.Columns.Add(new DataColumn("Width", Type.GetType("System.String")));
         DecorDT.Columns.Add(new DataColumn("PositionsCount", Type.GetType("System.String")));
         DecorDT.Columns.Add(new DataColumn("LabelsCount", Type.GetType("System.Int32")));
         DecorDT.Columns.Add(new DataColumn("FactoryType", Type.GetType("System.Int32")));
         DecorDT.Columns.Add(new DataColumn("DecorConfigID", Type.GetType("System.Int32")));
     }
 }
 private void OnButtonClickedAction()
 {
     SampleLabel.RelRotateTo(360, 1000);
 }