Beispiel #1
0
        public AboutBoxForm()
        {
            InitializeComponent();
            this.Text = String.Format("About {0}", AssemblyTitle.Replace(" Library", ""));
            this.labelProductName.Text = AssemblyProduct;
            this.labelVersion.Text     = String.Format("Version {0}", AssemblyVersion);
            linkLabel.Text             = "Get the last version and free support at http://wwww.sealreport.org";
            //check for license text
            string text = Repository.Instance.LicenseText;

            if (string.IsNullOrEmpty(text))
            {
                text = @"A genuine seal named 'Chocolat' from Dun Laoghaire, Dublin.

Visit our Web site, take a dive and join the Seal community...


Copyright(c) Seal Report, Eric Pfirsch ([email protected]).

Seal Report is licensed under the Apache License, Version 2.0.
http://www.apache.org/licenses/LICENSE-2.0.
";
            }
            this.textBoxDescription.Text = text;
            ShowIcon = true;
            Icon     = Repository.ProductIcon;
        }
Beispiel #2
0
 public AboutBoxForm()
 {
     InitializeComponent();
     this.Text = String.Format("About {0}", AssemblyTitle.Replace(" Library", ""));
     this.labelProductName.Text = AssemblyProduct;
     this.labelVersion.Text     = String.Format("Version {0}", AssemblyVersion);
     linkLabel.Text             = "Get the last version and free support at http://wwww.sealreport.org";
     ShowIcon = true;
     Icon     = Repository.ProductIcon;
 }
Beispiel #3
0
        public void WriteSuccessHeaders(int statusCode, string contentType, byte[] data)
        {
            string newline = Environment.NewLine;

            outputStream.Write(Encoding.UTF8.GetBytes("HTTP/1.1 " + statusCode.ToString() + " " + StatusCodes.Lookup(statusCode) + newline));
            outputStream.Write(Encoding.UTF8.GetBytes("Content-Type: " + contentType + newline));
            outputStream.Write(Encoding.UTF8.GetBytes("Server: " + AssemblyTitle.Replace(' ', '-') + '/' + AssemblyVersion + newline));
            outputStream.Write(Encoding.UTF8.GetBytes("Date: " + DateTime.UtcNow.ToString(DateTimeFormat) + newline));
            outputStream.Write(Encoding.UTF8.GetBytes("Connection: close" + newline));
            outputStream.Write(Encoding.UTF8.GetBytes("Content-Length: " + data.Length.ToString() + newline));
            outputStream.Write(Encoding.UTF8.GetBytes(newline));
            outputStream.Write(data);
        }
Beispiel #4
0
        public void WriteFailureHeaders(int errorCode)
        {
            string newline = Environment.NewLine;

            outputStream.Write(Encoding.UTF8.GetBytes("HTTP/1.1 " + errorCode.ToString() + " " + StatusCodes.Lookup(errorCode) + newline));
            outputStream.Write(Encoding.UTF8.GetBytes("Content-Type: text/html" + newline));
            outputStream.Write(Encoding.UTF8.GetBytes("Server: " + AssemblyTitle.Replace(' ', '-') + '/' + AssemblyVersion + newline));
            outputStream.Write(Encoding.UTF8.GetBytes("Date: " + DateTime.UtcNow.ToString(DateTimeFormat) + newline));
            outputStream.Write(Encoding.UTF8.GetBytes("Connection: close" + newline));

            string data = GetErrorDocument(errorCode);

            outputStream.Write(Encoding.UTF8.GetBytes("Content-Length: " + data.Length.ToString() + newline));
            outputStream.Write(Encoding.UTF8.GetBytes(newline));
            outputStream.Write(Encoding.UTF8.GetBytes(data));
        }
Beispiel #5
0
        /// <summary>
        /// Add componect to active doc
        /// </summary>
        void AddComponectToActiveDoc(string partFileName)
        {
            ModelDocExtension swDocExt;
            AssemblyDoc       swAssy;
            string            tmpPath;
            ModelDoc2         tmpObj;
            bool          boolstat;
            Component2    swcomponent;
            Feature       matefeature;
            string        MateName;
            string        FirstSelection;
            string        SecondSelection;
            swMateAlign_e Alignment;
            string        strCompName;
            string        AssemblyTitle;
            string        AssemblyName;
            int           errors   = 0;
            int           warnings = 0;
            int           mateError;

            // Get title of assembly document
            AssemblyTitle = pDoc.GetTitle();

            // Split the title into two strings using the period (.) as the delimiter
            string[] strings = AssemblyTitle.Split(new Char[] { '.' });

            // Use AssemblyName when mating the component with the assembly
            AssemblyName = (string)strings[0];


            boolstat = true;

            string strCompModelname = null;

            strCompModelname = partFileName;

            // Because the component resides in the same folder as the assembly, get
            // the assembly's path, strip out the assembly filename, concatenate
            // the rest of the path to the component filename, and use this string to
            // open the component
            tmpPath = pDoc.GetPathName();
            //int idx;
            //idx = tmpPath.LastIndexOf(AssemblyTitle);
            string compPath;

            //tmpPath = tmpPath.Substring(0, (idx));
            //compPath = string.Concat(tmpPath, strCompModelname);
            compPath = strCompModelname;

            // Open the component
            tmpObj = (ModelDoc2)swApp.OpenDoc6(compPath, (int)swDocumentTypes_e.swDocPART, 0, "", ref errors, ref warnings);

            // Check to see if the file is read-only or cannot be found; display error
            // messages if either
            if (warnings == (int)swFileLoadWarning_e.swFileLoadWarning_ReadOnly)
            {
                MessageBox.Show("This file is read-only.");
                boolstat = false;
            }

            if (tmpObj == null)
            {
                MessageBox.Show("Cannot locate the file.");
                boolstat = false;
            }

            //Re-activate the assembly so that you can add the component to it
            pDoc   = (ModelDoc2)swApp.ActivateDoc2(AssemblyTitle, true, ref errors);
            swAssy = (AssemblyDoc)pDoc;


            // Add the component to the assembly document.
            // Currently only one option,
            // swAddComponentConfigOptions_e.swAddComponentConfigOptions_CurrentSelectedConfig,
            // works for adding a part using AddComponent5

            // The other options,
            // swAddComponentConfigOptions_e.swAddComponentConfigOptions_NewConfigWithAllReferenceModels
            // and swAddComponentConfigOptions_e.swAddComponentConfigOptions_NewConfigWithAsmStructure,
            // work only for adding assemblies using AddComponent5
            swcomponent = (Component2)swAssy.AddComponent5(strCompModelname, (int)swAddComponentConfigOptions_e.swAddComponentConfigOptions_CurrentSelectedConfig, "", false, "", -1, -1, -1);

            // Get the name of the component for the mate
            strCompName = swcomponent.Name2;

            // Create the name of the mate and the names of the planes to use for the mate
            MateName        = "top_coinc_" + strCompName;
            FirstSelection  = "Top@" + strCompName + "@" + AssemblyName;
            SecondSelection = "Front@" + AssemblyName;
            swDocExt        = (ModelDocExtension)pDoc.Extension;
            pDoc.ClearSelection2(true);

            // Select the planes for the mate
            boolstat = swDocExt.SelectByID2(FirstSelection, "PLANE", 0, 0, 0, true, 1, null, (int)swSelectOption_e.swSelectOptionDefault);
            boolstat = swDocExt.SelectByID2(SecondSelection, "PLANE", 0, 0, 0, true, 1, null, (int)swSelectOption_e.swSelectOptionDefault);

            // Add the mate
            matefeature = (Feature)swAssy.AddMate3((int)swMateType_e.swMateCOINCIDENT, (int)swMateAlign_e.swMateAlignALIGNED, false, 0, 0, 0, 0, 0, 0, 0,
                                                   0, false, out mateError);
            matefeature.Name = MateName;

            pDoc.ViewZoomtofit2();
        }