Пример #1
0
 public ExtractorContext(ProjectData project)
 {
     fullNameIndex = new SortedList<string, TypeData>();
     Assemblies = new List<FileInfo>();
     DependantAssemblies = new List<FileInfo>();
     XmlDocumentation = new List<FileInfo>();
     AppDomain = AppDomain.CreateDomain(Guid.NewGuid().ToString());
     ProjectData = project;
 }
Пример #2
0
 public void SaveProjectData(ProjectData projectData)
 {
     if (this.GetProjectDataByProjectId(projectData.ProjectId) == null)
     {
         base.InsertData(projectData);
     }
     else
     {
         base.UpdateData(projectData);
     }
 }
Пример #3
0
        /// <summary>
        /// Manages the lifecycle of the ExtractorContext and delegates to child extractors.
        /// </summary>
        /// <param name="contextFunc"></param>
        /// <returns>A ProjectData object with all types from the requested assemblies</returns>
        public ProjectData Extract(Action<IExtractorContext> contextFunc)
        {
            ProjectData projectData = new ProjectData();
            using (ExtractorContext context = new ExtractorContext(projectData)) {
                contextFunc(context);

                DllExtractor.Extract(context);
                XmlExtractor.Extract(context);
            }
            return projectData;
        }
Пример #4
0
        public ProjectData Fetch(ProjectData data)
        {
            data.CreatedByUser = MockDb.Users
                .Where(row => row.UserId == data.CreatedBy)
                .Single();

            data.ModifiedByUser = MockDb.Users
                .Where(row => row.UserId == data.ModifiedBy)
                .Single();

            return data;
        }
Пример #5
0
        public void Should_Be_Able_To_Add()
        {
            // arrange
            ProjectData projectData = new ProjectData {Description = "Test Description",};
            Mock<IProjectRepository> mockProjectRepository = this.GetMockProjectRepository_ForSaving(projectData);
            ProjectService projectService = new ProjectService(mockProjectRepository.Object);

            // action
            projectService.SaveProjectData(projectData);

            // assert
            mockProjectRepository.VerifyAll();
        }
Пример #6
0
        public ProjectData Insert(ProjectData data)
        {
            if (MockDb.Projects.Count() == 0)
            {
                data.ProjectId = 1;
            }
            else
            {
                data.ProjectId = MockDb.Projects.Select(row => row.ProjectId).Max() + 1;
            }

            MockDb.Projects.Add(data);

            return data;
        }
Пример #7
0
        public ProjectData Fetch(ProjectDataCriteria criteria)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                         .GetManager(Database.ApplicationConnection, false))
            {
                var project = this.Fetch(ctx, criteria)
                    .Single();

                var projectData = new ProjectData();

                this.Fetch(project, projectData);

                return projectData;
            }
        }
Пример #8
0
        private void buttonConnect_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                BasicHttpBinding binding = new BasicHttpBinding();
                EndpointAddress endpoint = new EndpointAddress(textBoxAPIURL.Text);
                MantisConnectPortTypeClient client = new MantisConnectPortTypeClient(binding, endpoint);
                ProjectData[] projects = new ProjectData[0];

                listBoxProject.BeginUpdate();
                listBoxProject.Items.Clear();
                listBoxProject.Enabled = false;

                try
                {
                    projects = client.mc_projects_get_user_accessible(textBoxUsername.Text, textBoxPassword.Text);
                }
                catch (CommunicationException communicationException)
                {
                    MessageBox.Show(communicationException.ToString(), "communication exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                if (projects.Length > 0)
                {
                    listBoxProject.Items.AddRange(projects);
                    listBoxProject.SelectedIndex = 0;
                    listBoxProject.Enabled = true;
                }
            }
            catch (ProtocolException protocolException)
            {
                MessageBox.Show("connection failed: \n" + protocolException.Message);
            }
            catch (UriFormatException uriFormatException)
            {
                MessageBox.Show("incorrect URL: \n" + uriFormatException.Message);
            }
            catch (EndpointNotFoundException endpointNotFoundException)
            {
                MessageBox.Show("enpoint not found: \n" + endpointNotFoundException.Message);
            }
            finally
            {
                listBoxProject.EndUpdate();
                this.Cursor = Cursors.Default;
            }
        }
Пример #9
0
        // this method is really handy
        public static ITestElement New_MSVST4U_UnitTestElement(string assemblyFileLocation, string fullClassName, string methodName, ProjectData projectData)
        {
            // The UnitTestElement constructor needs a some basic information, most notably, the "TestMethod" instance
            // that wraps FullClassName and MethodName. The ugly part is, that even the TestMethod class is internal too.

            // Ah, and one more thing. When the Microsoft's internals somethimes try to quickly match or find tests with
            // the use customized generation of the test's IDs. It important to mimic those signature-like behaviour, just
            // to be sure that the test will not be improperly thought to be missing in some contexts.
            // For a "member-level" tests (that is, a test method or a test property), the keygen algorithm uses
            // a "full member name" as the generator's seed
            Guid testid = MSVST4U_Tunnels.EqtHash.GuidFromString(fullClassName + "." + methodName);
            // For a 'class-level' tests it would be a "full class name".

            var vsmethod = MSVST4U_Tunnels.CreateTestMethod(methodName, fullClassName);

            // This is the important trick: although we create the actual internal UnitTestElement, it is important
            // to set the test adapter class name to OURS. From the VisulStudio's point of view, the test adapter is
            // the entity responsible for actually running the test and for publishing its results. It not the TestElement,
            // but the Adapter is the perfect place to actually takeover the control!
            var ts = MSVST4U_Tunnels.CreateTestElement(testid, methodName, typeof(XUnitTestAdapter).AssemblyQualifiedName, vsmethod);

            // We are not living in the perfect world, so of course, the internal UnitTestElement's constructor had
            // to skip a few important parts: the Storage must be set manually to CodeBase/Location of the assembly with tests,
            // and also the CodeBase must be set, too. If left empty or null, the test.IsValid would turn to false and the
            // TMI would warn and ignore them as not runnable.
            // Another thing that must be set is the ProjectData property. Without it the UnitTest would be accepted,
            // but its "project name", "solution name", and a few other properties would be missing, and it would
            // render a few features unavailable (like double clicking on the test in a not-yet-run test list and
            // jupming to the test's source)

            // BTW. see Microsoft.VisualStudio.TestTools.TestTypes.Unit.VSTypeEnumerator.AddTest for full test construction
            // workflow, both for CF and .Net and ASP tests.

            // BTW. if a UnitTestElement is to be returned, why not to call that method?????

            MSVST4U_Tunnels.TS_AssignCodeBase(ts, assemblyFileLocation);
            ts.ProjectData = projectData;
            ts.Storage = assemblyFileLocation;

            // and the last thing - setting the Storage and ProjectData has marked the test as 'Modified', we don't
            // want that - all in all, the test is fresly loaded.
            // BTW. the original Microsoft's code behaves in the exact same way: sets Storage, clears IsModified :)
            ts.IsModified = false; // reset the change marker

            return ts;
        }
Пример #10
0
        /// <summary>
        /// Loads elements from specified location into memory
        /// 
        /// This method uses exceptions for error conditions -- Not return values.
        /// </summary>
        /// <param name="assemblyFileLocation">Location to load tests from.</param>
        /// <param name="projectData">Project information object.</param>
        /// <param name="warningHandler">Warning handler that processes warnings.</param>
        /// <returns>The data that has been loaded</returns>
        public override ICollection Load(string assemblyFileLocation, ProjectData projectData, IWarningHandler warningHandler)
        {
            Guard.StringNotNullOrEmpty(assemblyFileLocation, "location");

            IExecutorWrapper executor = null;

            try
            {
                // The ExecutorWrapper is the xUnit's version-resilient layer for communicating with different
                // versions of the main xunit.dll. The XUnitVSRunner is thus ignorant about that module and will
                // try to communicate and use whatever version is actually referenced in the unit test's assembly.
                executor = new ExecutorWrapper(assemblyFileLocation, configFilename: null, shadowCopy: true);
            }
            catch (ArgumentException ex)
            {
                Trace.WriteLine("No xUnit tests found in '" + assemblyFileLocation + "':");
                Trace.WriteLine(ex);
            }
            #if DEBUG
            catch (Exception ex)
            {
                Trace.TraceError("Error at XUnitTestTip.Load: " + ex.Message);
                throw;
            }
            #endif

            var tests = new List<ITestElement>(); // Collection of tests loaded from disk
            if (executor == null) return tests;

            using (executor)
            {
                var testAssembly = TestAssemblyBuilder.Build(executor);

                // the magic is in this two-liner: we ask the xUnit to find all tests and then
                // with heavy use of Reflection we create the actual internal Microsoft's UnitTestElements
                // that will contain all required information about the test's location
                foreach (var xmethod in testAssembly.EnumerateTestMethods())
                    tests.Add(MSVST4U_Access.New_MSVST4U_UnitTestElement(
                        assemblyFileLocation,
                        xmethod.TestClass.TypeName,
                        xmethod.MethodName,
                        projectData));
            }

            return tests;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // Check if the user has logged in using his/her Accenture credentials
            //if (Session["uname"] == null)
            //{
            //    Response.Redirect("Logout.aspx");
            //}

            if (!IsPostBack)
            {
                ProjectData pd = new ProjectData();
                hidUserId.Value = Common.GetUser().ToString();
                dgTop20Projects.DataSource = pd.FetchLatest20Projects(Convert.ToInt32(hidUserId.Value));
                dgTop20Projects.DataBind();

            }
        }
        public static GallioTestElement CreateTestElement(TestData test, string assemblyPath, ProjectData projectData)
        {
            GallioTestElement testElement = new GallioTestElement(test.Id, test.Name,
                test.Metadata.GetValue(MetadataKeys.Description) ?? "", assemblyPath);
            testElement.ProjectData = projectData;

            foreach (KeyValuePair<string, IList<string>> pair in test.Metadata)
                testElement.Properties[pair.Key] = pair.Value.Count == 1 ? (object)pair.Value[0] : pair.Value;

            testElement.Owner = test.Metadata.GetValue(MetadataKeys.AuthorName) ?? "";

            testElement.SetCodeReference(test.CodeReference.AssemblyName, test.CodeReference.NamespaceName,
                test.CodeReference.TypeName, test.CodeReference.MemberName, test.CodeReference.ParameterName);
            testElement.SetCodeLocation(test.CodeLocation.Path, test.CodeLocation.Line, test.CodeLocation.Column);

            testElement.Timeout = 0; // disable Visual Studio's built-in timeout handling, Gallio manages its own timeouts
            return testElement;
        }
Пример #13
0
        public override ICollection Load(string location, ProjectData projectData, IWarningHandler warningHandler)
        {
            // Skip loading if the extension is not fully initalized unless we are not
            // running in Visual Studio (because we are running in MSTest instead).
            if (!TipShellExtension.IsInitialized && ShellEnvironment.IsRunningInVisualStudio)
                return EmptyArray<TestElement>.Instance;

            // Explore the tests.
            ITestFrameworkManager testFrameworkManager = RuntimeAccessor.ServiceLocator.Resolve<ITestFrameworkManager>();
            WarningLogger logger = new WarningLogger(warningHandler);

            ReflectionOnlyAssemblyLoader loader = new ReflectionOnlyAssemblyLoader();
            loader.AddHintDirectory(Path.GetDirectoryName(location));

            IAssemblyInfo assembly = loader.ReflectionPolicy.LoadAssemblyFrom(location);

            var testFrameworkSelector = new TestFrameworkSelector()
            {
                Filter = testFrameworkHandle => testFrameworkHandle.Id != "MSTestAdapter.TestFramework",
                FallbackMode = TestFrameworkFallbackMode.Approximate
            };

            ITestDriver driver = testFrameworkManager.GetTestDriver(testFrameworkSelector, logger);
            TestExplorationOptions testExplorationOptions = new TestExplorationOptions();

            ArrayList tests = new ArrayList();
            MessageConsumer messageConsumer = new MessageConsumer()
                .Handle<TestDiscoveredMessage>(message =>
                {
                    if (message.Test.IsTestCase)
                        tests.Add(GallioTestElementFactory.CreateTestElement(message.Test, location, projectData));
                })
                .Handle<AnnotationDiscoveredMessage>(message =>
                {
                    message.Annotation.Log(logger, true);
                });

            driver.Describe(loader.ReflectionPolicy, new ICodeElementInfo[] { assembly },
                testExplorationOptions, messageConsumer, NullProgressMonitor.CreateInstance());

            return tests;
        }
Пример #14
0
        public ProjectData[] FetchLookupInfoList(ProjectDataCriteria criteria)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                          .GetManager(Database.ApplicationConnection, false))
            {
                var projects = this.Fetch(ctx, criteria)
                    .AsEnumerable();

                var projectDataList = new List<ProjectData>();

                foreach (var project in projects)
                {
                    var projectData = new ProjectData();

                    this.Fetch(project, projectData);

                    projectDataList.Add(projectData);
                }

                return projectDataList.ToArray();
            }
        }
Пример #15
0
        private static T smethod_0 <T>([In] T obj0) where T : Form, new()
        {
            T obj;

            if (((object)obj0 == null ? 1 : (obj0.IsDisposed ? 1 : 0)) != 0)
            {
                if (Class3.Class6 <> .hashtable_0 != null)
                {
                    if (Class3.Class6 <> .hashtable_0.ContainsKey((object)typeof(T)))
                    {
                        throw new InvalidOperationException(Utils.GetResourceString("WinForms_RecursiveFormCreate", new string[0]));
                    }
                }
                else
                {
                    Class3.Class6 <> .hashtable_0 = new Hashtable();
                }
                Class3.Class6 <> .hashtable_0.Add((object)typeof(T), (object)null);

                try
                {
                    obj = Activator.CreateInstance <T>();
                }
                catch (TargetInvocationException ex) when(
                {
                    // ISSUE: unable to correctly present filter
                    ProjectData.SetProjectError((Exception)ex);
                    if (ex.InnerException != null)
                    {
                        SuccessfulFiltering;
                    }
                    else
                    {
                        throw;
                    }
                }
        public void init(GMapMarker marker)
        {
            // check authentication
            GPLC.Auth(GPLCAuthority.Administrator);

            this.marker = marker;
            // initial
            if (marker is ProjectMarker)
            {
                ProjectData p = (marker as ProjectMarker).ProjectData;
                label_project.Text = "設定專案";
                InputButton.Text   = "Modify";
                setInput(p.id, p.name, p.addr, p.lat, p.lng);
                DeleteButton.Visible = true;
            }
            else
            {
                label_project.Text = "新增專案";
                setInput(null, "", "", marker.Position.Lat, marker.Position.Lng);
                InputButton.Dock = DockStyle.Fill;
            }
            label_info.Text = "";
            this.Show();
        }
Пример #17
0
 private void nom_prenom_Click(object sender, EventArgs e)
 {
     try
     {
         MySqlCommand mySqlCommand = new MySqlCommand();
         Globals.conn.Open();
         mySqlCommand.Connection  = Globals.conn;
         mySqlCommand.CommandText = "select distinct concat(prenom,concat(' ',nom)) from INFO_PERSO ";
         mySqlCommand.Connection  = Globals.conn;
         mySqlCommand.CommandType = CommandType.Text;
         MySqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader();
         nom_prenom.Items.Clear();
         if (mySqlDataReader.HasRows)
         {
             while (mySqlDataReader.Read())
             {
                 nom_prenom.Items.Add(RuntimeHelpers.GetObjectValue(mySqlDataReader.GetValue(0)));
             }
         }
         else
         {
             MessageBox.Show("No result for your Data", "Infos", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         }
     }
     catch (Exception ex)
     {
         ProjectData.SetProjectError(ex);
         Exception ex2 = ex;
         MessageBox.Show(ex2.Message.ToString());
         ProjectData.ClearProjectError();
     }
     finally
     {
         Globals.conn.Close();
     }
 }
Пример #18
0
        public static bool ModifyFileBytes(string FileName, long StartOffset, long Length, byte[] Data)
        {
            bool flag;

            try
            {
                Data = (byte[])Utils.CopyArray((Array)Data, new byte[((int)(Length - 1L)) + 1]);
                FileStream stream = new FileStream(FileName, FileMode.Open, FileAccess.Write)
                {
                    Position = StartOffset
                };
                stream.Write(Data, 0, Data.Length);
                stream.Close();
                flag = true;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                flag = false;
                ProjectData.ClearProjectError();
            }
            return(flag);
        }
        public void OnInitialize_AllAccountTypesAdded_AccountRelatedPropertiesNotEmpty()
        {
            var windowManager = Substitute.For <IWindowManager>();
            var dialogs       = Substitute.For <IDialogs>();
            var fileSystem    = Substitute.For <IFileSystem>();
            var processApi    = Substitute.For <IProcess>();
            var projectData   = new ProjectData(new Settings(), windowManager, dialogs, fileSystem, processApi);
            var sut           = new EditBookingViewModel(projectData, YearBegin);

            foreach (AccountDefinitionType type in Enum.GetValues(typeof(AccountDefinitionType)))
            {
                sut.Accounts.Add(new AccountDefinition {
                    Name = type.ToString(), Type = type
                });
            }

            ((IActivate)sut).Activate();

            sut.Accounts.Should().NotBeEmpty();
            sut.IncomeAccounts.Should().NotBeEmpty();
            sut.IncomeRemoteAccounts.Should().NotBeEmpty();
            sut.ExpenseAccounts.Should().NotBeEmpty();
            sut.ExpenseRemoteAccounts.Should().NotBeEmpty();
        }
        static void BugReport(string sData)
        {
            var targetUrl = "https://github.com/ImaginaryDevelopment/imaginary-hero-designer/issues";

            try
            {
                if (sData.Length > 0)
                {
                    sData = sData.Replace("\r\n", "-");
                    if (sData.Length > 96)
                    {
                        sData = sData.Substring(0, 96);
                    }
                }
                Process.Start(targetUrl);
                //Process.Start("http://www.honourableunited.org.uk/mhdreport.php" + "?" + "ver=" + Strings.Format( 1.962f, "##0.#####") + "&db=" + Strings.Format( DatabaseAPI.Database.Version, "##0.#####") + " (" + Strings.Format( DatabaseAPI.Database.Date, "dd/MM/yy") + ")&OS=" + OS.GetQuickOsid() + "&data=" + sData);
            }
            catch (Exception ex)
            {
                ProjectData.SetProjectError(ex);
                Interaction.MsgBox(targetUrl + "\r\n\r\n" + ex.Message, MsgBoxStyle.Critical, "Error");
                ProjectData.ClearProjectError();
            }
        }
Пример #21
0
 public void KhoiTao(string _ComPortName, int _BaudRate)
 {
     try
     {
         SerialPort comPort = this.ComPort;
         comPort.BaudRate = _BaudRate;
         comPort.DataBits = 8;
         comPort.StopBits = StopBits.One;
         comPort.Parity   = Parity.None;
         comPort.ReceivedBytesThreshold = 1;
         comPort.PortName = _ComPortName;
         comPort.Open();
     }
     catch (Exception expr_3B)
     {
         ProjectData.SetProjectError(expr_3B);
         UcConsole.ComPortErrorEventHandler comPortErrorEvent = this.ComPortErrorEvent;
         if (comPortErrorEvent != null)
         {
             comPortErrorEvent("ComPort Console Error");
         }
         ProjectData.ClearProjectError();
     }
 }
Пример #22
0
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            object rotationScale = null;

            if (!(value is string))
            {
                rotationScale = base.ConvertFrom(context, culture, RuntimeHelpers.GetObjectValue(value));
            }
            else
            {
                string   str       = Conversions.ToString(value);
                string[] strArrays = str.Split(new char[] { ',' });
                try
                {
                    rotationScale = new RotationScale(Conversions.ToSingle(strArrays[0]), Conversions.ToSingle(strArrays[1]), Conversions.ToSingle(strArrays[2]), Conversions.ToSingle(strArrays[3]), Conversions.ToInteger(strArrays[4]), Conversions.ToInteger(strArrays[5]));
                }
                catch (Exception exception)
                {
                    ProjectData.SetProjectError(exception);
                    throw new InvalidCastException(Conversions.ToString(value));
                }
            }
            return(rotationScale);
        }
Пример #23
0
    public string LookupCountryCode(string _IPAddress)
    {
        string result;

        try
        {
            if (!global::Globals.G_Utilities.IsIpAddressValid(_IPAddress))
            {
                result = "--";
            }
            else
            {
                IPAddress iPAddress = IPAddress.Parse(_IPAddress);
                result = this.LookupCountryCode(iPAddress);
            }
        }
        catch (FormatException expr_26)
        {
            ProjectData.SetProjectError(expr_26);
            result = "--";
            ProjectData.ClearProjectError();
        }
        return(result);
    }
Пример #24
0
        public void DeletePay(string account)
        {
            MySqlConnection connection = DAO.GetConnection();

            try
            {
                connection.Open();
                string       cmdText      = "DELETE FROM pay_infos WHERE account_name=?account_name";
                MySqlCommand mySqlCommand = new MySqlCommand(cmdText, connection);
                mySqlCommand.Parameters.AddWithValue("?account_name", account);
                mySqlCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                ProjectData.SetProjectError(ex);
                Exception ex2 = ex;
                log.Error((object)ex2.ToString());
                ProjectData.ClearProjectError();
            }
            finally
            {
                connection.Close();
            }
        }
Пример #25
0
 void ShowRecipeInfo(int Index)
 {
     if (Index <0 | Index> DatabaseAPI.Database.Recipes.Length - 1)
     {
         ClearInfo();
     }
     else
     {
         NoUpdate            = true;
         txtRecipeName.Text  = DatabaseAPI.Database.Recipes[Index].InternalName;
         cbEnh.SelectedIndex = DatabaseAPI.Database.Recipes[Index].EnhIdx + 1;
         try
         {
             lblEnh.Text = DatabaseAPI.Database.Enhancements[DatabaseAPI.Database.Recipes[Index].EnhIdx].LongName;
         }
         catch (Exception ex)
         {
             ProjectData.SetProjectError(ex);
             lblEnh.Text = string.Empty;
             ProjectData.ClearProjectError();
         }
         cbRarity.SelectedIndex = (int)DatabaseAPI.Database.Recipes[Index].Rarity;
         txtExtern.Text         = DatabaseAPI.Database.Recipes[Index].ExternalName;
         lstItems.Items.Clear();
         int num = DatabaseAPI.Database.Recipes[Index].Item.Length - 1;
         for (int index = 0; index <= num; ++index)
         {
             lstItems.Items.Add(("Level: " + Convert.ToString(DatabaseAPI.Database.Recipes[Index].Item[index].Level + 1)));
         }
         if (lstItems.Items.Count > 0)
         {
             lstItems.SelectedIndex = 0;
         }
         NoUpdate = false;
     }
 }
Пример #26
0
 private void ShowPage(int pPageIndex)
 {
     this.Cursor = Cursors.WaitCursor;
     try
     {
         CPage cPage = this.myPages[pPageIndex];
         if (!Information.IsNothing(cPage))
         {
             this.m_DrawingSymbols = CSymbols.String2KHs(cPage.Symbols);
         }
         this.AxMap1.Refresh();
     }
     catch (Exception expr_40)
     {
         ProjectData.SetProjectError(expr_40);
         Exception ex = expr_40;
         Interaction.MsgBox(ex.Message, MsgBoxStyle.Critical, "Show Error");
         ProjectData.ClearProjectError();
     }
     this.Cursor    = Cursors.Default;
     this.iCurrPage = pPageIndex;
     this.AxMap1.Select();
     this.AxMap1.CurrentTool = ToolConstants.miPanTool;
 }
Пример #27
0
        private static void LoopDelete(string dir)
        {
            IEnumerator <string> enumerator;

            try
            {
                enumerator = MyProject.Computer.FileSystem.GetFiles(dir).GetEnumerator();
                while (enumerator.MoveNext())
                {
                    string current = enumerator.Current;
                    try
                    {
                        if (File.Exists(current))
                        {
                            File.Delete(current);
                        }
                        continue;
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        Functions.write_error(exception);
                        ProjectData.ClearProjectError();
                        continue;
                    }
                }
            }
            finally
            {
                if (enumerator != null)
                {
                    enumerator.Dispose();
                }
            }
        }
Пример #28
0
        /// <summary>
        /// For a project master data model, populate our display project model with its details and files attached
        /// </summary>
        private async Task <ProjectDisplayModel> GetProjectModel(ProjectData project, IHeaderDictionary headers)
        {
            var projectModel = new ProjectDisplayModel
            {
                ProjectName = project.Name,
                ProjectUid  = project.ProjectUID,
                IsActive    = !project.IsArchived
            };

            var files = await fileImportProxy.GetFiles(project.ProjectUID, UserId, headers);

            foreach (var fileData in files.Where(f => f.ImportedFileType == ImportedFileType.DesignSurface))
            {
                projectModel.Files.Add(new FileDisplayModel
                {
                    FileName     = fileData.Name,
                    FileUid      = fileData.ImportedFileUid,
                    FileType     = fileData.ImportedFileType,
                    FileTypeName = fileData.ImportedFileTypeName
                });
            }

            return(projectModel);
        }
Пример #29
0
 private void OKButton_Click(object eventSender, EventArgs eventArgs)
 {
     try
     {
         if (!Versioned.IsNumeric((object)this.txtAreaSize.Text) || Conversions.ToDouble(this.txtAreaSize.Text) <= 0.0)
         {
             int num1 = (int)Interaction.MsgBox((object)"Area size must be a positive number.", MsgBoxStyle.Critical, (object)null);
         }
         else
         {
             int    integer1 = Conversions.ToInteger(this.cboAreaType.SelectedValue);
             int    integer2 = Conversions.ToInteger(this.cboUseType.SelectedValue);
             double AreaSize = double.Parse(this.txtAreaSize.Text.ToString());
             string str      = FunctionalArea.AddFuncArea(this.txtAreaName.Text, mdUtility.fMainForm.CurrentBldg, integer1, integer2, AreaSize, this.lblAreaSize.Text);
             if (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(str, "Duplicate", false) == 0)
             {
                 int num2 = (int)Interaction.MsgBox((object)"Functional Area Already Exists", MsgBoxStyle.Critical, (object)null);
                 this.txtAreaName.Text = "";
                 this.txtAreaName.Focus();
             }
             else if ((uint)Microsoft.VisualBasic.CompilerServices.Operators.CompareString(str, "", false) > 0U)
             {
                 MyProject.Forms.frmMain.tvFunctionality.ActiveNode = MyProject.Forms.frmMain.tvFunctionality.GetNodeByKey(str);
                 MyProject.Forms.frmMain.tvFunctionality.Refresh();
                 mdHierarchyFunction.LoadFunctionalityTree();
                 this.Close();
             }
         }
     }
     catch (Exception ex)
     {
         ProjectData.SetProjectError(ex);
         mdUtility.Errorhandler(ex, nameof(frmNewFuncArea), nameof(OKButton_Click));
         ProjectData.ClearProjectError();
     }
 }
Пример #30
0
        public void TcQuJianShanChu()
        {
            int    num;
            int    num4;
            object obj2;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                string text = Interaction.InputBox("输入数值区间:\r\nA,B  删除A~B之间的数值\r\nA,   删除小于等于A的数值\r\n,B   删除大于等于B的数值", "田草CAD工具箱-数值区间删除", "", -1, -1);
IL_22:
                num2 = 3;
                if (Operators.CompareString(text, "", false) != 0)
                {
                    goto IL_3A;
                }
IL_35:
                goto IL_341;
IL_3A:
                num2 = 6;
IL_3C:
                num2 = 7;
                string[] array = text.Split(new char[]
                {
                    ','
                });
IL_53:
                num2 = 8;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_61:
                num2 = 9;
                Database database = mdiActiveDocument.Database;
IL_6D:
                num2 = 10;
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    TypedValue[] array2 = new TypedValue[1];
                    Array        array3 = array2;
                    TypedValue   typedValue;
                    typedValue..ctor(0, "TEXT");
                    array3.SetValue(typedValue, 0);
                    SelectionFilter       selectionFilter = new SelectionFilter(array2);
                    PromptSelectionResult selection       = mdiActiveDocument.Editor.GetSelection(selectionFilter);
                    if (selection.Status == 5100)
                    {
                        SelectionSet value      = selection.Value;
                        IEnumerator  enumerator = value.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            object         obj            = enumerator.Current;
                            SelectedObject selectedObject = (SelectedObject)obj;
                            DBText         dbtext         = (DBText)transaction.GetObject(selectedObject.ObjectId, 1);
                            NF.CVal(dbtext.TextString);
                            if (array.Length >= 2)
                            {
                                if ((Operators.CompareString(array[0], "", false) != 0 & Operators.CompareString(array[1], "", false) != 0) && (NF.CVal(dbtext.TextString) >= Conversion.Val(array[0]) & NF.CVal(dbtext.TextString) <= Conversion.Val(array[1])))
                                {
                                    Class36.smethod_64(dbtext.ObjectId);
                                }
                                if ((Operators.CompareString(array[0], "", false) != 0 & Operators.CompareString(array[1], "", false) == 0) && NF.CVal(dbtext.TextString) <= Conversion.Val(array[0]))
                                {
                                    Class36.smethod_64(dbtext.ObjectId);
                                }
                                if ((Operators.CompareString(array[0], "", false) == 0 & Operators.CompareString(array[1], "", false) != 0) && NF.CVal(dbtext.TextString) >= Conversion.Val(array[1]))
                                {
                                    Class36.smethod_64(dbtext.ObjectId);
                                }
                            }
                            else if (array.Length == 1 && NF.CVal(dbtext.TextString) <= Conversion.Val(array[0]))
                            {
                                Class36.smethod_64(dbtext.ObjectId);
                            }
                        }
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                    }
                    transaction.Commit();
                }
IL_2B2:
                goto IL_341;
IL_2B7:
                int num3 = num4 + 1;
                num4     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num3);
IL_2FB:
                goto IL_336;
IL_2FD:
                num4 = num2;
                if (num <= -2)
                {
                    goto IL_2B7;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_313 :;
            }
            catch when(endfilter(obj2 is Exception & num != 0 & num4 == 0))
            {
                Exception ex = (Exception)obj3;

                goto IL_2FD;
            }
IL_336:
            throw ProjectData.CreateProjectError(-2146828237);
IL_341:
            if (num4 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
Пример #31
0
        public void TcE8200()
        {
            int    num;
            int    num4;
            object obj2;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_16:
                num2 = 3;
                Database database = mdiActiveDocument.Database;
IL_1F:
                num2 = 4;
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    TypedValue[] array  = new TypedValue[2];
                    Array        array2 = array;
                    TypedValue   typedValue;
                    typedValue..ctor(0, "TEXT");
                    array2.SetValue(typedValue, 0);
                    Array array3 = array;
                    typedValue..ctor(1, "%%1328@200");
                    array3.SetValue(typedValue, 1);
                    SelectionFilter       selectionFilter = new SelectionFilter(array);
                    PromptSelectionResult selection       = mdiActiveDocument.Editor.GetSelection(selectionFilter);
                    if (selection.Status == 5100)
                    {
                        SelectionSet value      = selection.Value;
                        IEnumerator  enumerator = value.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            object         obj            = enumerator.Current;
                            SelectedObject selectedObject = (SelectedObject)obj;
                            DBText         dbtext         = (DBText)transaction.GetObject(selectedObject.ObjectId, 1);
                            Class36.smethod_64(dbtext.ObjectId);
                        }
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                    }
                    transaction.Commit();
                }
IL_11A:
                goto IL_186;
IL_11C:
                int num3 = num4 + 1;
                num4     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num3);
IL_140:
                goto IL_17B;
IL_142:
                num4 = num2;
                if (num <= -2)
                {
                    goto IL_11C;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_158 :;
            }
            catch when(endfilter(obj2 is Exception & num != 0 & num4 == 0))
            {
                Exception ex = (Exception)obj3;

                goto IL_142;
            }
IL_17B:
            throw ProjectData.CreateProjectError(-2146828237);
IL_186:
            if (num4 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
        bool ParseClasses(string iFileName)

        {
            int          num1 = 0;
            StreamReader iStream;

            try
            {
                iStream = new StreamReader(iFileName);
            }
            catch (Exception ex)
            {
                ProjectData.SetProjectError(ex);
                int  num2 = (int)Interaction.MsgBox(ex.Message, MsgBoxStyle.Critical, "Bonus CSV Not Opened");
                bool flag = false;
                ProjectData.ClearProjectError();
                return(flag);
            }
            int num3 = 0;
            int num4 = 0;
            int num5 = 0;
            int num6 = DatabaseAPI.Database.EnhancementSets.Count - 1;

            for (int index1 = 0; index1 <= num6; ++index1)
            {
                DatabaseAPI.Database.EnhancementSets[index1].Bonus        = new EnhancementSet.BonusItem[0];
                DatabaseAPI.Database.EnhancementSets[index1].SpecialBonus = new EnhancementSet.BonusItem[6];
                int num2 = DatabaseAPI.Database.EnhancementSets[index1].SpecialBonus.Length - 1;
                for (int index2 = 0; index2 <= num2; ++index2)
                {
                    DatabaseAPI.Database.EnhancementSets[index1].SpecialBonus[index2]           = new EnhancementSet.BonusItem();
                    DatabaseAPI.Database.EnhancementSets[index1].SpecialBonus[index2].Name      = new string[0];
                    DatabaseAPI.Database.EnhancementSets[index1].SpecialBonus[index2].Index     = new int[0];
                    DatabaseAPI.Database.EnhancementSets[index1].SpecialBonus[index2].AltString = "";
                    DatabaseAPI.Database.EnhancementSets[index1].SpecialBonus[index2].Special   = -1;
                }
            }
            try
            {
                string iLine;
                do
                {
                    iLine = FileIO.ReadLineUnlimited(iStream, char.MinValue);
                    if (iLine != null && !iLine.StartsWith("#"))
                    {
                        ++num5;
                        if (num5 >= 9)
                        {
                            this.BusyMsg(Strings.Format(num3, "###,##0") + " records parsed.");
                            num5 = 0;
                        }
                        string[] array  = CSV.ToArray(iLine);
                        int      index1 = DatabaseAPI.NidFromUidioSet(array[0]);
                        if (index1 > -1)
                        {
                            int        integer   = Conversions.ToInteger(array[1]);
                            string[]   strArray1 = array[3].Split(" ".ToCharArray());
                            Enums.ePvX ePvX      = Enums.ePvX.Any;
                            if (array[2].Contains("isPVPMap?"))
                            {
                                ePvX     = Enums.ePvX.PvP;
                                array[2] = array[2].Replace("isPVPMap?", "").Replace("  ", " ");
                            }
                            string[] strArray2 = array[2].Split(" ".ToCharArray());
                            if (array[2] == "")
                            {
                                DatabaseAPI.Database.EnhancementSets[index1].Bonus = (EnhancementSet.BonusItem[])Utils.CopyArray(DatabaseAPI.Database.EnhancementSets[index1].Bonus, (Array) new EnhancementSet.BonusItem[DatabaseAPI.Database.EnhancementSets[index1].Bonus.Length + 1]);
                                DatabaseAPI.Database.EnhancementSets[index1].Bonus[DatabaseAPI.Database.EnhancementSets[index1].Bonus.Length - 1] = new EnhancementSet.BonusItem();
                                EnhancementSet.BonusItem[] bonus = DatabaseAPI.Database.EnhancementSets[index1].Bonus;
                                int index2 = DatabaseAPI.Database.EnhancementSets[index1].Bonus.Length - 1;
                                bonus[index2].AltString = "";
                                bonus[index2].Name      = new string[strArray1.Length - 1 + 1];
                                bonus[index2].Index     = new int[strArray1.Length - 1 + 1];
                                int num2 = bonus[index2].Name.Length - 1;
                                for (int index3 = 0; index3 <= num2; ++index3)
                                {
                                    bonus[index2].Name[index3]  = strArray1[index3];
                                    bonus[index2].Index[index3] = DatabaseAPI.NidFromUidPower(strArray1[index3]);
                                }
                                bonus[index2].Special = -1;
                                bonus[index2].PvMode  = ePvX;
                                bonus[index2].Slotted = integer;
                            }
                            else
                            {
                                int num2 = -1;
                                int num7 = strArray2.Length - 1;
                                for (int index2 = 0; index2 <= num7; ++index2)
                                {
                                    int num8 = DatabaseAPI.NidFromUidEnh(strArray2[index2]);
                                    if (num8 > -1)
                                    {
                                        int num9 = DatabaseAPI.Database.EnhancementSets[index1].Enhancements.Length - 1;
                                        for (int index3 = 0; index3 <= num9; ++index3)
                                        {
                                            if (DatabaseAPI.Database.EnhancementSets[index1].Enhancements[index3] == num8)
                                            {
                                                num2 = index3;
                                                break;
                                            }
                                        }
                                        break;
                                    }
                                }
                                if (num2 > -1)
                                {
                                    EnhancementSet.BonusItem[] specialBonus = DatabaseAPI.Database.EnhancementSets[index1].SpecialBonus;
                                    int index2 = num2;
                                    specialBonus[index2].AltString = "";
                                    specialBonus[index2].Name      = new string[strArray1.Length - 1 + 1];
                                    specialBonus[index2].Index     = new int[strArray1.Length - 1 + 1];
                                    int num8 = specialBonus[index2].Name.Length - 1;
                                    for (int index3 = 0; index3 <= num8; ++index3)
                                    {
                                        specialBonus[index2].Name[index3]  = strArray1[index3];
                                        specialBonus[index2].Index[index3] = DatabaseAPI.NidFromUidPower(strArray1[index3]);
                                    }
                                    specialBonus[index2].Special = num2;
                                    specialBonus[index2].PvMode  = ePvX;
                                    specialBonus[index2].Slotted = integer;
                                }
                            }
                            ++num1;
                        }
                        else
                        {
                            ++num4;
                        }
                        ++num3;
                    }
                }while (iLine != null);
            }
            catch (Exception ex)
            {
                ProjectData.SetProjectError(ex);
                Exception exception = ex;
                iStream.Close();
                int  num2 = (int)Interaction.MsgBox(exception.Message, MsgBoxStyle.Critical, "Power Class CSV Parse Error");
                bool flag = false;
                ProjectData.ClearProjectError();
                return(flag);
            }
            iStream.Close();
            var serializer = My.MyApplication.GetSerializer();

            DatabaseAPI.SaveEnhancementDb(serializer);
            this.DisplayInfo();
            int num10 = (int)Interaction.MsgBox(("Parse Completed!\r\nTotal Records: " + Conversions.ToString(num3) + "\r\nGood: " + Conversions.ToString(num1) + "\r\nRejected: " + Conversions.ToString(num4)), MsgBoxStyle.Information, "File Parsed");

            return(true);
        }
Пример #33
0
        public ProjectData Update(ProjectData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                         .GetManager(Database.ApplicationConnection, false))
            {
                var project =
                    new Project
                    {
                        ProjectId = data.ProjectId
                    };

                ctx.ObjectContext.Projects.Attach(project);

                DataMapper.Map(data, project);

                ctx.ObjectContext.SaveChanges();

                return data;
            }
        }
Пример #34
0
		IEnumerable<DocumentInfo> CreateDocuments (ProjectData projectData, MonoDevelop.Projects.Project p, CancellationToken token, MonoDevelop.Projects.ProjectFile [] sourceFiles)
		{
			var duplicates = new HashSet<DocumentId> ();

			// use given source files instead of project.Files because there may be additional files added by msbuild targets
			foreach (var f in sourceFiles) {
				if (token.IsCancellationRequested)
					yield break;
				if (f.Subtype == MonoDevelop.Projects.Subtype.Directory)
					continue;
				SourceCodeKind sck;
				if (TypeSystemParserNode.IsCompileableFile (f, out sck)) {
					if (!duplicates.Add (projectData.GetOrCreateDocumentId (f.Name)))
						continue;
					yield return CreateDocumentInfo (solutionData, p.Name, projectData, f, sck);
				} else {
					foreach (var projectedDocument in GenerateProjections (f, projectData, p)) {
						if (!duplicates.Add (projectData.GetOrCreateDocumentId (projectedDocument.FilePath)))
							continue;
						yield return projectedDocument;
					}
				}
			}
		}
Пример #35
0
		ProjectData GetOrCreateProjectData (ProjectId id)
		{
			lock (projectIdMap) {
				ProjectData result;
				if (!projectDataMap.TryGetValue (id, out result)) {
					result = new ProjectData (id);
					projectDataMap [id] = result;
				}
				return result;
			}
		}
Пример #36
0
        public bool UnCompress()
        {
            bool result = true;

            checked
            {
                int num = _original.Count - 3;
                _uncompressed = new List <byte>();
                _control      = new List <Control>();
                try
                {
                    int num2 = num;
                    int num3 = 0;
                    while (true)
                    {
                        int num4 = num3;
                        int num5 = num2;
                        if (num4 > num5)
                        {
                            break;
                        }
                        byte   b  = _original[num3];
                        byte   b2 = _original[num3 + 1];
                        byte   b3 = _original[num3 + 2];
                        byte[] ba = new byte[3] {
                            b, b2, b3
                        };
                        if (!ThreadingModule.IsControlSequence(ref ba))
                        {
                            Trap t    = null;
                            bool trap = GetTrap(num3, ref t);
                            if (!ThreadingModule.isDeflateSequence(ref ba))
                            {
                                _uncompressed.Add(b);
                                if (num3 == num)
                                {
                                    _uncompressed.Add(b2);
                                    _uncompressed.Add(b3);
                                }
                            }
                            else
                            {
                                if (trap)
                                {
                                    SetRealOffset(num3, _uncompressed.Count);
                                }
                                int num6 = b2;
                                int num7 = 1;
                                while (true)
                                {
                                    int num8 = num7;
                                    num5 = num6;
                                    if (num8 > num5)
                                    {
                                        break;
                                    }
                                    _uncompressed.Add(b3);
                                    num7++;
                                }
                                num3 += 2;
                            }
                        }
                        else
                        {
                            Control control = new Control();
                            control.Offset      = _uncompressed.Count;
                            control.ControlType = new byte[3] {
                                b, b2, b3
                            };
                            _control.Add(control);
                            _uncompressed.Add(247);
                            num3 += 2;
                        }
                        num3++;
                    }
                }
                catch (Exception ex)
                {
                    ProjectData.SetProjectError(ex);
                    Exception ex2 = ex;
                    result = false;
                    ProjectData.ClearProjectError();
                }
                return(result);
            }
        }
 private void saveNewProjectData(ProjectData data)
 {
     XmlSerializer serializer = new XmlSerializer(typeof(ProjectData));
     //string exeFolder = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
       		TextWriter textWriter = new StreamWriter(data.projectFolderPath + "\\" + data.projectName + ".xml");
       		serializer.Serialize(textWriter, data);
       		textWriter.Close();
 }
Пример #38
0
 public void Save(ITestElement[] tests, string location, ProjectData projectData)
 {
     target.Save(tests, location, projectData);
 }
Пример #39
0
 public ICollection Load(string location, ProjectData projectData, IWarningHandler warningHandler)
 {
     return target.Load(location, projectData, warningHandler);
 }
Пример #40
0
        private void Fetch(Project project, ProjectData projectData)
        {
            DataMapper.Map(project, projectData);

            projectData.CreatedByUser = new UserData();
            DataMapper.Map(project.CreatedByUser, projectData.CreatedByUser);

            projectData.ModifiedByUser = new UserData();
            DataMapper.Map(project.ModifiedByUser, projectData.ModifiedByUser);
        }
Пример #41
0
        internal static void Main()
        {
            //check if we are in the right place...
            if (!System.IO.Directory.Exists(Application.StartupPath + "\\Data"))
            {
                MessageBox.Show("Run Editor from inside the Client folder!");
                ProjectData.EndApp();
            }

            if (E_Globals.GameStarted == true)
            {
                return;
            }

            SFML.Portable.Activate();

            //Strings.Init(1, "English")

            ClientDataBase.ClearTempTile();

            // set values for directional blocking arrows
            E_Globals.DirArrowX[1] = (byte)12;             // up
            E_Globals.DirArrowY[1] = (byte)0;
            E_Globals.DirArrowX[2] = (byte)12;             // down
            E_Globals.DirArrowY[2] = (byte)23;
            E_Globals.DirArrowX[3] = (byte)0;              // left
            E_Globals.DirArrowY[3] = (byte)12;
            E_Globals.DirArrowX[4] = (byte)23;             // right
            E_Globals.DirArrowY[4] = (byte)12;

            ClientDataBase.CheckTilesets();
            ClientDataBase.CheckCharacters();
            ClientDataBase.CheckPaperdolls();
            ClientDataBase.CheckAnimations();
            E_Items.CheckItems();
            ClientDataBase.CheckResources();
            ClientDataBase.CheckSkillIcons();
            ClientDataBase.CheckFaces();
            ClientDataBase.CheckFog();
            ClientDataBase.CacheMusic();
            ClientDataBase.CacheSound();

            E_Housing.CheckFurniture();
            E_Projectiles.CheckProjectiles();

            E_Graphics.InitGraphics();

            E_AutoTiles.Autotile = new E_AutoTiles.AutotileRec[E_Types.Map.MaxX + 1, E_Types.Map.MaxY + 1];

            for (var X = 0; X <= E_Types.Map.MaxX; X++)
            {
                for (var Y = 0; Y <= E_Types.Map.MaxY; Y++)
                {
                    E_AutoTiles.Autotile[(int)X, (int)Y].Layer = new E_AutoTiles.QuarterTileRec[(int)Enums.LayerType.Count];
                    for (var i = 0; i <= (int)Enums.LayerType.Count - 1; i++)
                    {
                        E_AutoTiles.Autotile[(int)X, (int)Y].Layer[(int)i].srcX        = new int[5];
                        E_AutoTiles.Autotile[(int)X, (int)Y].Layer[(int)i].srcY        = new int[5];
                        E_AutoTiles.Autotile[(int)X, (int)Y].Layer[(int)i].QuarterTile = new E_AutoTiles.PointRec[5];
                    }
                }
            }

            //'Housing
            E_Housing.House       = new E_Housing.HouseRec[E_Housing.MAX_HOUSES + 1];
            E_Housing.HouseConfig = new E_Housing.HouseRec[E_Housing.MAX_HOUSES + 1];

            //quests
            E_Quest.Quest = new E_Quest.QuestRec[E_Quest.MAX_QUESTS + 1];
            E_Quest.ClearQuests();

            E_Types.Map.Npc = new int[Constants.MAX_MAP_NPCS + 1];

            Types.Item = new Types.ItemRec[Constants.MAX_ITEMS + 1];
            for (var i = 0; i <= Constants.MAX_ITEMS; i++)
            {
                for (var x = 0; x <= (int)Enums.StatType.Count - 1; x++)
                {
                    Types.Item[(int)i].Add_Stat = new byte[(int)x + 1];
                }
                for (var x = 0; x <= (int)Enums.StatType.Count - 1; x++)
                {
                    Types.Item[(int)i].Stat_Req = new byte[(int)x + 1];
                }

                Types.Item[(int)i].FurnitureBlocks = new int[4, 4];
                Types.Item[(int)i].FurnitureFringe = new int[4, 4];
            }

            Types.Npc = new Types.NpcRec[Constants.MAX_NPCS + 1];
            for (var i = 0; i <= Constants.MAX_NPCS; i++)
            {
                for (var x = 0; x <= (int)Enums.StatType.Count - 1; x++)
                {
                    Types.Npc[(int)i].Stat = new byte[(int)x + 1];
                }

                Types.Npc[(int)i].DropChance    = new int[6];
                Types.Npc[(int)i].DropItem      = new int[6];
                Types.Npc[(int)i].DropItemValue = new int[6];

                Types.Npc[(int)i].Skill = new byte[7];
            }

            E_Types.MapNpc = new E_Types.MapNpcRec[Constants.MAX_MAP_NPCS + 1];
            for (var i = 0; i <= Constants.MAX_MAP_NPCS; i++)
            {
                for (var x = 0; x <= (int)Enums.VitalType.Count - 1; x++)
                {
                    E_Types.MapNpc[(int)i].Vital = new int[(int)x + 1];
                }
            }

            Types.Shop = new Types.ShopRec[Constants.MAX_SHOPS + 1];
            for (var i = 0; i <= Constants.MAX_SHOPS; i++)
            {
                for (var x = 0; x <= Constants.MAX_TRADES; x++)
                {
                    Types.Shop[(int)i].TradeItem = new Types.TradeItemRec[(int)x + 1];
                }
            }

            Types.Animation = new Types.AnimationRec[Constants.MAX_ANIMATIONS + 1];
            for (var i = 0; i <= Constants.MAX_ANIMATIONS; i++)
            {
                for (var x = 0; x <= 1; x++)
                {
                    Types.Animation[(int)i].Sprite = new int[(int)x + 1];
                }
                for (var x = 0; x <= 1; x++)
                {
                    Types.Animation[(int)i].Frames = new int[(int)x + 1];
                }
                for (var x = 0; x <= 1; x++)
                {
                    Types.Animation[(int)i].LoopCount = new int[(int)x + 1];
                }
                for (var x = 0; x <= 1; x++)
                {
                    Types.Animation[(int)i].LoopTime = new int[(int)x + 1];
                }
            }

            //craft
            E_Crafting.ClearRecipes();

            //pets
            E_Pets.ClearPets();

            // load options
            if (File.Exists(Application.StartupPath + "\\Data\\Config.xml"))
            {
                LoadOptions();
            }
            else
            {
                CreateOptions();
            }

            E_NetworkConfig.InitNetwork();

            E_Globals.GameDestroyed = false;
            E_Globals.GameStarted   = true;

            FrmLogin.Default.Visible = true;

            GameLoop();
        }
 private void saveNewProjectData(ProjectData data)
 {
     WarningSystem.addWarning("Attempt to Save ProjectData", "Shouldn't be called in render", Code.Error);
     /*
     XmlSerializer serializer = new XmlSerializer(typeof(ProjectData));
     //string exeFolder = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
       		TextWriter textWriter = new StreamWriter(data.projectFolderPath + "\\" + data.projectName + ".xml");
       		serializer.Serialize(textWriter, data);
       		textWriter.Close();
       		*/
 }
Пример #43
0
        public void TcQuTongShanChu()
        {
            int    num;
            int    num6;
            object obj2;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                long num3 = Conversions.ToLong(Interaction.InputBox("输入通筋面积", "田草CAD工具箱-板筋去通删除", "", -1, -1));
IL_27:
                num2 = 3;
                if (num3 != 0L)
                {
                    goto IL_3C;
                }
IL_37:
                goto IL_1EA;
IL_3C:
                num2 = 6;
IL_3E:
                num2 = 7;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_4B:
                num2 = 8;
                Database database = mdiActiveDocument.Database;
IL_55:
                num2 = 9;
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    TypedValue[] array  = new TypedValue[1];
                    Array        array2 = array;
                    TypedValue   typedValue;
                    typedValue..ctor(0, "TEXT");
                    array2.SetValue(typedValue, 0);
                    SelectionFilter       selectionFilter = new SelectionFilter(array);
                    PromptSelectionResult selection       = mdiActiveDocument.Editor.GetSelection(selectionFilter);
                    if (selection.Status == 5100)
                    {
                        SelectionSet value      = selection.Value;
                        IEnumerator  enumerator = value.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            object         obj            = enumerator.Current;
                            SelectedObject selectedObject = (SelectedObject)obj;
                            DBText         dbtext         = (DBText)transaction.GetObject(selectedObject.ObjectId, 1);
                            double         num4           = NF.CVal(dbtext.TextString);
                            if (num4 <= (double)num3)
                            {
                                dbtext.Erase();
                            }
                            else
                            {
                                dbtext.TextString = Conversions.ToString(num4 - (double)num3);
                            }
                        }
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                    }
                    transaction.Commit();
                }
IL_15F:
                goto IL_1EA;
IL_164:
                int num5 = num6 + 1;
                num6     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num5);
IL_1A4:
                goto IL_1DF;
IL_1A6:
                num6 = num2;
                if (num <= -2)
                {
                    goto IL_164;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_1BC :;
            }
            catch when(endfilter(obj2 is Exception & num != 0 & num6 == 0))
            {
                Exception ex = (Exception)obj3;

                goto IL_1A6;
            }
IL_1DF:
            throw ProjectData.CreateProjectError(-2146828237);
IL_1EA:
            if (num6 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
    void Start()
    {
        // Build a list of all projects
        string path = Application.dataPath + "\\projects\\";
        bool previousProjects = DirectoryUtil.AssertDirectoryExistsOrRecreate(path);

        if(previousProjects)
        {
            DirectoryInfo[] subDirs = DirectoryUtil.getSubDirectoriesByParent(path);
            foreach(DirectoryInfo info in subDirs)
            {
                ProjectData newProject = new ProjectData();
                newProject.projectFolderPath = info.FullName;
                newProject.projectName = info.Name;
                //WarningSystem.addWarning("New Project Folder", "New path:" + newProject.projectFolderPath, Code.Info);
                projects.Add(newProject);

            }
        }
    }
Пример #45
0
        private WebHookDataContext GetWebHookDataContext(Version version)
        {
            string json = File.ReadAllText(Path.GetFullPath(Path.Combine("..", "..", "..", "ErrorData", "1477.expected.json")));

            var settings = GetService <JsonSerializerSettings>();

            settings.Formatting = Formatting.Indented;

            var ev = JsonConvert.DeserializeObject <PersistentEvent>(json, settings);

            ev.OrganizationId = TestConstants.OrganizationId;
            ev.ProjectId      = TestConstants.ProjectId;
            ev.StackId        = TestConstants.StackId;
            ev.Id             = TestConstants.EventId;

            var context = new WebHookDataContext(version, ev, OrganizationData.GenerateSampleOrganization(GetService <BillingManager>(), GetService <BillingPlans>()), ProjectData.GenerateSampleProject())
            {
                Stack = StackData.GenerateStack(id: TestConstants.StackId, organizationId: TestConstants.OrganizationId, projectId: TestConstants.ProjectId, title: _formatter.GetStackTitle(ev), signatureHash: "722e7afd4dca4a3c91f4d94fec89dfdc")
            };

            context.Stack.Tags = new TagSet {
                "Test"
            };
            context.Stack.FirstOccurrence = context.Stack.LastOccurrence = ev.Date.UtcDateTime;

            return(context);
        }
    void OnGUI()
    {
        //GuiManager guiManager = GameObject.Find("GuiManagerObject").GetComponent<GuiManager>();
        GUI.skin =  GuiManager.GetSkin();
        GUI.depth = 10;
        // Launch Screen
        GUI.BeginGroup (new Rect (Screen.width / 2 - 175, Screen.height / 2 - 250, 250, 380));
        // All rectangles are now adjusted to the group. (0,0) is the topleft corner of the group.

        // We'll make a box so you can see where the group is on-screen.
        GUI.Box (new Rect (0,0,250,380), "Anyfish Editor");

        if(GUI.Button (new Rect (65,40,120,32), "New Project"))
        {
            isDisplayingNamePrompt = true;
        }

        if(GUI.Button (new Rect (65,80,120,32), "Load Project"))
        {
            if(projectSelectionIndex != -1)
            {
                GameRegistry activeRegistry = gameObject.GetComponent<GameRegistry>();
                activeRegistry.activeProjectDirectory = projects[projectSelectionIndex].projectFolderPath;
                activeRegistry.switchState(States.ProjectEditor);
            }
            else
            {
                WarningSystem.addWarning("Select a Project", "Please selection a project before loading.", Code.Warning);
            }
        }

        if(isDisplayingNamePrompt)
            GUI.enabled = false;
        scrollViewVector = GUI.BeginScrollView (new Rect (15, 140, 220, 120), scrollViewVector, new Rect (0, 0, 200, 1000));

        projectSelectionIndex = GUILayout.SelectionGrid(projectSelectionIndex, getProjectNames(), 1, "toggle");

        // End the ScrollView
        GUI.EndScrollView();
        GUI.enabled = true;
        if(isDisplayingNamePrompt)
        {

            GUI.Box (new Rect (30,80,190,180), "Enter Project Name:");

            GUI.SetNextControlName("ProjectNameField");
            projectName = GUI.TextField(new Rect(50, 120, 150, 32), projectName, 40);
            GUI.FocusControl("ProjectNameField");

            if(GUI.Button(new Rect(50, 190, 150, 32), "Ok"))
            {
                isDisplayingNamePrompt = false;

                // Create Project Directory and Add to the display list
                Directory.CreateDirectory(Application.dataPath + "\\projects\\" + projectName);
                ProjectData newProject = new ProjectData();

                //Creates a relative path for the project which is used in the xml file later. (Mohammad)
                string relative= "";
                if (Directory.Exists(Application.dataPath))
                {
                    string p = Application.dataPath;
                    string parpath1 = Directory.GetParent(Application.dataPath).FullName;
                    string parpath2 = Directory.GetParent(parpath1).FullName;
                    string parpath3 = Directory.GetParent(parpath2).FullName;
                    relative = "../../" + Application.dataPath.Remove(0,parpath3.Length)+ "\\projects\\" + projectName;
                }

                //newProject.projectFolderPath = Application.dataPath + "\\projects\\" + projectName;
                newProject.projectFolderPath = relative;
                newProject.projectName = projectName;
                newProject.tankDimensions.x = 1000;
                newProject.tankDimensions.z = 700;
                newProject.tankDimensions.y = 1000;
                createDirectoryIfItDoesntExist("tps", newProject.projectFolderPath);
                createDirectoryIfItDoesntExist("fins", newProject.projectFolderPath);
                createDirectoryIfItDoesntExist("textures", newProject.projectFolderPath);
                createDirectoryIfItDoesntExist("paths", newProject.projectFolderPath);
                Debug.Log("Project path: " + newProject.projectFolderPath);
                    saveNewProjectData(newProject);
                projects.Add(newProject);
                WarningSystem.addWarning("New Project Folder", "New path:" + newProject.projectFolderPath, Code.Info);

            }
        }
        if(GUI.Button (new Rect (65,290,120,32), "About"))
        {
            WarningSystem.addWarning("Version Info",  "Version: 1.1 \t\tReleased: Jan 1, 2014 \nUpdates: Keyframe multi-selection, version info etc. ", Code.Info);
        }
        // End the group we started above. This is very important to remember!
        GUI.EndGroup ();
    }
Пример #47
0
        public bool Compress(ref Exception result)
        {
            bool result2 = true;

            _compressed = new List <byte>();
            checked
            {
                try
                {
                    int  num  = 0;
                    int  num2 = _uncompressed.Count - 3;
                    int  num3 = 0;
                    byte b2   = default(byte);
                    byte b3   = default(byte);
                    while (true)
                    {
                        int num4 = num3;
                        int num5 = num2;
                        if (num4 > num5)
                        {
                            break;
                        }
                        byte b = _uncompressed[num3];
                        b2 = _uncompressed[num3 + 1];
                        b3 = _uncompressed[num3 + 2];
                        unchecked
                        {
                            if (isNonDeflate(num3) && b == 247)
                            {
                                _compressed.Add(247);
                                _compressed.Add(1);
                                _compressed.Add(247);
                            }
                            else
                            {
                                int  num6 = 0;
                                int  num7 = 255;
                                Trap t    = new Trap();
                                bool flag = false;
                                if (GetTrapByRealOffset(num3, ref t))
                                {
                                    num7 = t.Repeat;
                                    flag = true;
                                }
                                if (b == b2 && b != b3)
                                {
                                    _compressed.Add(b);
                                }
                                else if (b == b2 && b == b3)
                                {
                                    int num8 = num3;
                                    checked
                                    {
                                        int num9 = _uncompressed.Count - 1;
                                        num = num8;
                                        while (true)
                                        {
                                            int num10 = num;
                                            num5 = num9;
                                            if (num10 > num5)
                                            {
                                                break;
                                            }
                                            if (b == _uncompressed[num])
                                            {
                                                num6++;
                                                if (num6 == num7)
                                                {
                                                    num3 += num6 - 1;
                                                    _compressed.Add(247);
                                                    _compressed.Add((byte)num6);
                                                    _compressed.Add(b);
                                                    num = _uncompressed.Count;
                                                    if (flag)
                                                    {
                                                        _compressed.Add(t.HexCode);
                                                        num3++;
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                num3 += num6 - 1;
                                                _compressed.Add(247);
                                                _compressed.Add((byte)num6);
                                                _compressed.Add(b);
                                                num = _uncompressed.Count;
                                            }
                                            num++;
                                        }
                                    }
                                }
                                else
                                {
                                    _compressed.Add(b);
                                }
                            }
                        }
                        num3++;
                    }
                    if (num3 == _uncompressed.Count - 2)
                    {
                        _compressed.Add(b2);
                        _compressed.Add(b3);
                    }
                    if (num3 == _uncompressed.Count - 1)
                    {
                        _compressed.Add(b3);
                    }
                }
                catch (Exception ex)
                {
                    ProjectData.SetProjectError(ex);
                    Exception ex2 = ex;
                    result2 = false;
                    ProjectData.ClearProjectError();
                }
                return(result2);
            }
        }
Пример #48
0
    public static void InitSettings()
    {
        //Discarded unreachable code: IL_015f, IL_01c9, IL_01cb, IL_01db, IL_01fd
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num = 3;
            My.MySettingsProperty.Settings.subfolders = true;
            num = 4;
            My.MySettingsProperty.Settings.hidden = true;
            num = 5;
            My.MySettingsProperty.Settings.smart = true;
            num = 6;
            My.MySettingsProperty.Settings.created = "L";
            num = 7;
            My.MySettingsProperty.Settings.path = "S";
            num = 8;
            My.MySettingsProperty.Settings.name = "S";
            num = 9;
            string str = "|";
            num  = 10;
            str += Environment.GetEnvironmentVariable("WinDir");
            num  = 11;
            str  = str + "|" + Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
            num  = 12;
            string empty = string.Empty;
            num   = 13;
            empty = Environment.GetEnvironmentVariable("ProgramFiles(x86)");
            num   = 14;
            if (empty != null)
            {
                num = 15;
                if (empty.Length > 0)
                {
                    num = 16;
                    str = str + "|" + empty;
                }
            }
            num = 17;
            str = str + "|" + Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
            num = 18;
            str = str + "|" + Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
            num = 19;
            str = str + "|" + Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "|";
            num = 20;
            My.MySettingsProperty.Settings.exclude = str;
            num = 21;
            My.MySettingsProperty.Settings.types = "P:JPEG Image:jpg.jpeg.jpe|P:Portable Network Graphic:png|P:Graphical Interchange Format File:gif|P:Bitmap Image File:bmp|P:Icon File:ico|P:Adobe Photoshop Document:psd|P:Tagged Image File:tif.tiff|P:Windows Cursor:cur|P:Windows Animated Cursor:ani|P:Targa Graphic:tga|P:Adobe Illustrator File:ai|P:Adobe PhotoDeluxe Image:pdd|P:Deluxe Paint Bitmap Image:lbm|P:Device Independent Bitmap File:dib|P:Digital Negative Image File:dng|P:Dr. Halo Bitmap Image File:cut|P:Encapsulated PostScript File:eps|P:High Dynamic Range Image File:hdr|P:JPEG 2000 Image:jp2.j2k.j2c|P:Kodak Photo CD Image File:pcd|P:Multiple Network Graphic:mng|P:Paintbrush Bitmap Image File:pcx|P:Pentax Electronic File:pef|P:Picture File:pct.pict.pic|P:Pixar Image File:pxr|P:Portable Pixmap Image File:ppm|P:Misc. Camera RAW File:raw.mos.mrw.nef.orf.dcr.crw.raf|P:Run Length Encoded Bitmap:rle|P:Scitex Continuous Tone File:sct|P:Silicon Graphics Image File:sgi|P:Sun Raster Graphic:ras|P:Targa Bitmap Image File:vda|P:Targa ICB Bitmap Image:icb|P:Wireless Bitmap Image File:wbm.wbmp|P:X11 Graphic:xbm.xpm";
            num = 22;
            My.MySettingsProperty.Settings.Save();
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_01fb: Could not find block for branch target IL_01cb*/;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #49
0
		static DocumentInfo CreateDocumentInfo (SolutionData data, string projectName, ProjectData id, MonoDevelop.Projects.ProjectFile f, SourceCodeKind sourceCodeKind)
		{
			var filePath = f.FilePath;
			return DocumentInfo.Create (
				id.GetOrCreateDocumentId (filePath),
				filePath,
				new [] { projectName }.Concat (f.ProjectVirtualPath.ParentDirectory.ToString ().Split (Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)),
				sourceCodeKind,
				CreateTextLoader (data, f.Name),
				f.Name,
				false
			);
		}
        public void PropertiesWriterToString()
        {
            var productBaseDir     = TestUtils.CreateTestSpecificFolder(TestContext, "PropertiesWriterTest_ProductBaseDir");
            var productProject     = CreateEmptyFile(productBaseDir, "MyProduct.csproj");
            var productFile        = CreateEmptyFile(productBaseDir, "File.cs");
            var productChineseFile = CreateEmptyFile(productBaseDir, "你好.cs");

            var productCoverageFilePath = CreateEmptyFile(productBaseDir, "productCoverageReport.txt").FullName;

            CreateEmptyFile(productBaseDir, "productTrx.trx");
            var productFileListFilePath = Path.Combine(productBaseDir, "productManagedFiles.txt");

            var otherDir = TestUtils.CreateTestSpecificFolder(TestContext, "PropertiesWriterTest_OtherDir");
            var missingFileOutsideProjectDir = new FileInfo(Path.Combine(otherDir, "missing.cs"));

            var productFiles = new List <FileInfo>
            {
                productFile,
                productChineseFile,
                missingFileOutsideProjectDir
            };
            var productCS = new ProjectData(CreateProjectInfo("你好", "DB2E5521-3172-47B9-BA50-864F12E6DFFF", productProject, false, productFiles, productFileListFilePath, productCoverageFilePath, ProjectLanguages.CSharp, "UTF-8"));

            productCS.SonarQubeModuleFiles.Add(productFile);
            productCS.SonarQubeModuleFiles.Add(productChineseFile);
            productCS.SonarQubeModuleFiles.Add(missingFileOutsideProjectDir);

            var productVB = new ProjectData(CreateProjectInfo("vbProject", "B51622CF-82F4-48C9-9F38-FB981FAFAF3A", productProject, false, productFiles, productFileListFilePath, productCoverageFilePath, ProjectLanguages.VisualBasic, "UTF-8"));

            productVB.SonarQubeModuleFiles.Add(productFile);

            var testBaseDir          = TestUtils.CreateTestSpecificFolder(TestContext, "PropertiesWriterTest_TestBaseDir");
            var testProject          = CreateEmptyFile(testBaseDir, "MyTest.csproj");
            var testFile             = CreateEmptyFile(testBaseDir, "File.cs");
            var testFileListFilePath = Path.Combine(testBaseDir, "testManagedFiles.txt");

            var testFiles = new List <FileInfo>
            {
                testFile
            };
            var test = new ProjectData(CreateProjectInfo("my_test_project", "DA0FCD82-9C5C-4666-9370-C7388281D49B", testProject, true, testFiles, testFileListFilePath, null, ProjectLanguages.VisualBasic, "UTF-8"));

            test.SonarQubeModuleFiles.Add(testFile);

            var config = new AnalysisConfig()
            {
                SonarProjectKey     = "my_project_key",
                SonarProjectName    = "my_project_name",
                SonarProjectVersion = "1.0",
                SonarOutputDir      = @"C:\my_folder",
                SourcesDirectory    = @"d:\source_files\"
            };

            string actual = null;

            using (new AssertIgnoreScope()) // expecting the property writer to complain about the missing file
            {
                var writer = new PropertiesWriter(config, new TestLogger());
                writer.WriteSettingsForProject(productCS);
                writer.WriteSettingsForProject(productVB);
                writer.WriteSettingsForProject(test);

                actual = writer.Flush();
            }

            var expected = string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                         @"DB2E5521-3172-47B9-BA50-864F12E6DFFF.sonar.projectKey=my_project_key:DB2E5521-3172-47B9-BA50-864F12E6DFFF
DB2E5521-3172-47B9-BA50-864F12E6DFFF.sonar.projectName=\u4F60\u597D
DB2E5521-3172-47B9-BA50-864F12E6DFFF.sonar.projectBaseDir={0}
DB2E5521-3172-47B9-BA50-864F12E6DFFF.sonar.sourceEncoding=utf-8
DB2E5521-3172-47B9-BA50-864F12E6DFFF.sonar.sources=\
{0}\\File.cs,\
{0}\\\u4F60\u597D.cs,\
{2}

DB2E5521-3172-47B9-BA50-864F12E6DFFF.sonar.working.directory=C:\\my_folder\\.sonar\\mod0
B51622CF-82F4-48C9-9F38-FB981FAFAF3A.sonar.projectKey=my_project_key:B51622CF-82F4-48C9-9F38-FB981FAFAF3A
B51622CF-82F4-48C9-9F38-FB981FAFAF3A.sonar.projectName=vbProject
B51622CF-82F4-48C9-9F38-FB981FAFAF3A.sonar.projectBaseDir={0}
B51622CF-82F4-48C9-9F38-FB981FAFAF3A.sonar.sourceEncoding=utf-8
B51622CF-82F4-48C9-9F38-FB981FAFAF3A.sonar.sources=\
{0}\\File.cs

B51622CF-82F4-48C9-9F38-FB981FAFAF3A.sonar.working.directory=C:\\my_folder\\.sonar\\mod1
DA0FCD82-9C5C-4666-9370-C7388281D49B.sonar.projectKey=my_project_key:DA0FCD82-9C5C-4666-9370-C7388281D49B
DA0FCD82-9C5C-4666-9370-C7388281D49B.sonar.projectName=my_test_project
DA0FCD82-9C5C-4666-9370-C7388281D49B.sonar.projectBaseDir={1}
DA0FCD82-9C5C-4666-9370-C7388281D49B.sonar.sourceEncoding=utf-8
DA0FCD82-9C5C-4666-9370-C7388281D49B.sonar.sources=
DA0FCD82-9C5C-4666-9370-C7388281D49B.sonar.tests=\
{1}\\File.cs

DA0FCD82-9C5C-4666-9370-C7388281D49B.sonar.working.directory=C:\\my_folder\\.sonar\\mod2
sonar.modules=DB2E5521-3172-47B9-BA50-864F12E6DFFF,B51622CF-82F4-48C9-9F38-FB981FAFAF3A,DA0FCD82-9C5C-4666-9370-C7388281D49B

",
                                         PropertiesWriter.Escape(productBaseDir),
                                         PropertiesWriter.Escape(testBaseDir),
                                         PropertiesWriter.Escape(missingFileOutsideProjectDir));

            SaveToResultFile(productBaseDir, "Expected.txt", expected.ToString());
            SaveToResultFile(productBaseDir, "Actual.txt", actual);

            actual.Should().Be(expected);
        }
Пример #51
0
		IEnumerable<DocumentInfo> GenerateProjections (MonoDevelop.Projects.ProjectFile f, ProjectData projectData, MonoDevelop.Projects.Project p, HashSet<DocumentId> duplicates = null)
		{
			var mimeType = DesktopService.GetMimeTypeForUri (f.FilePath);
			var node = TypeSystemService.GetTypeSystemParserNode (mimeType, f.BuildAction);
			if (node == null || !node.Parser.CanGenerateProjection (mimeType, f.BuildAction, p.SupportedLanguages))
				yield break;
			var options = new ParseOptions {
				FileName = f.FilePath,
				Project = p,
				Content = TextFileProvider.Instance.GetReadOnlyTextEditorData (f.FilePath),
			};
			var projections = node.Parser.GenerateProjections (options);
			var entry = new ProjectionEntry ();
			entry.File = f;
			var list = new List<Projection> ();
			entry.Projections = list;
			foreach (var projection in projections.Result) {
				list.Add (projection);
				if (duplicates != null && !duplicates.Add (projectData.GetOrCreateDocumentId (projection.Document.FileName)))
					continue;
				var plainName = projection.Document.FileName.FileName;
				yield return DocumentInfo.Create (
					projectData.GetOrCreateDocumentId (projection.Document.FileName),
					plainName,
					new [] { p.Name }.Concat (f.ProjectVirtualPath.ParentDirectory.ToString ().Split (Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)),
					SourceCodeKind.Regular,
					TextLoader.From (TextAndVersion.Create (new MonoDevelopSourceText (projection.Document), VersionStamp.Create (), projection.Document.FileName)),
					projection.Document.FileName,
					false
				);
			}
			projectionList.Add (entry);
		}
Пример #52
0
        public void TcFace()
        {
            int    num;
            int    num4;
            object obj2;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_16:
                num2 = 3;
                Database database = mdiActiveDocument.Database;
IL_1F:
                num2 = 4;
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    TypedValue[] array  = new TypedValue[1];
                    Array        array2 = array;
                    TypedValue   typedValue;
                    typedValue..ctor(0, "3DFACE");
                    array2.SetValue(typedValue, 0);
                    SelectionFilter       selectionFilter = new SelectionFilter(array);
                    PromptSelectionResult selection       = mdiActiveDocument.Editor.GetSelection(selectionFilter);
                    if (selection.Status == 5100)
                    {
                        SelectionSet value      = selection.Value;
                        IEnumerator  enumerator = value.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            object         obj            = enumerator.Current;
                            SelectedObject selectedObject = (SelectedObject)obj;
                            Face           face           = (Face)transaction.GetObject(selectedObject.ObjectId, 1);
                            Interaction.MsgBox(face.GetVertexAt(0).ToString(), MsgBoxStyle.OkOnly, null);
                            CAD.AddPoint(face.GetVertexAt(0));
                        }
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                    }
                    transaction.Commit();
                }
IL_121:
                num2 = 6;
                if (Information.Err().Number <= 0)
                {
                    goto IL_146;
                }
IL_132:
                num2 = 7;
                Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null);
IL_146:
                goto IL_1C2;
IL_148:
                int num3 = num4 + 1;
                num4     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num3);
IL_17C:
                goto IL_1B7;
IL_17E:
                num4 = num2;
                if (num <= -2)
                {
                    goto IL_148;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_194 :;
            }
            catch when(endfilter(obj2 is Exception & num != 0 & num4 == 0))
            {
                Exception ex = (Exception)obj3;

                goto IL_17E;
            }
IL_1B7:
            throw ProjectData.CreateProjectError(-2146828237);
IL_1C2:
            if (num4 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
Пример #53
0
 public override void Save(ITestElement[] tests, string location, ProjectData projectData)
 {
     throw new NotSupportedException();
 }
Пример #54
0
    // Token: 0x06000190 RID: 400 RVA: 0x00033E48 File Offset: 0x00032048
    public static string luz(string lvy)
    {
        int    num4;
        int    num5;
        string text;
        object obj;

        try
        {
            for (;;)
            {
IL_00:
                int num = 1;
                for (;;)
                {
IL_118:
                    uint num2 = 2967155751u;
                    for (;;)
                    {
                        uint num3;
                        switch ((num3 = (num2 ^ 3523635790u)) % 9u)
                        {
                        case 0u:
                            goto IL_118;

                        case 1u:
                            goto IL_4E;

                        case 2u:
                        {
                            object objectValue = RuntimeHelpers.GetObjectValue(Interaction.CreateObject(< Module >.smethod_0(476752), ""));
                            num2 = (num3 * 1861385551u ^ 318803022u);
                            continue;
                        }

                        case 3u:
                            goto IL_12;

                        case 4u:
                            goto IL_3C;

                        case 7u:
                            goto IL_13B;

                        case 8u:
IL_11F:
                            num4 = num;
                            switch (num5)
                            {
                            case 0:
                                break;

                            case 1:
                                goto IL_12;

                            default:
                                num2 = 3810160604u;
                                continue;
                            }
                            break;
                        }
                        goto Block_4;
IL_12:
                        int num6 = num4 + 1;
                        num4     = 0;
                        switch (num6)
                        {
                        case 0:
                            goto IL_139;

                        case 1:
                            goto IL_00;

                        case 2:
IL_3C:
                            ProjectData.ClearProjectError();
                            num5 = 1;
                            num2 = 2471584126u;
                            break;

                        case 3:
                        {
IL_4E:
                            num = 3;
                            object   objectValue;
                            object   instance   = objectValue;
                            Type     type       = null;
                            string   memberName = < Module >.smethod_0(476800);
                            object[] array      = new object[]
                            {
                                lvy
                            };
                            object[] arguments     = array;
                            string[] argumentNames = null;
                            Type[]   typeArguments = null;
                            bool[]   array2        = new bool[]
                            {
                                true
                            };
                            object value = NewLateBinding.LateGet(instance, type, memberName, arguments, argumentNames, typeArguments, array2);
                            if (array2[0])
                            {
                                lvy = (string)Conversions.ChangeType(RuntimeHelpers.GetObjectValue(array[0]), typeof(string));
                            }
                            text = Conversions.ToString(value);
                            num2 = 2319185985u;
                            break;
                        }

                        case 4:
                            goto IL_13B;

                        default:
                            num2 = 3518048547u;
                            break;
                        }
                    }
                }
            }
Block_4:
IL_139:
            goto IL_15F;
IL_13B:
            goto IL_16A;
        }
        catch when(endfilter(obj is Exception & num5 != 0 & num4 == 0))
        {
            Exception ex = (Exception)obj2;

            goto IL_11F;
        }
IL_15F:
        throw ProjectData.CreateProjectError(-2146828237);
IL_16A:
        string result = text;

        if (num4 != 0)
        {
            ProjectData.ClearProjectError();
        }
        return(result);
    }
Пример #55
0
        public static void GameLoop()
        {
            Point    dest      = new Point(frmMapEditor.Default.PointToScreen(frmMapEditor.Default.picScreen.Location).X, frmMapEditor.Default.PointToScreen(frmMapEditor.Default.picScreen.Location).Y);
            Graphics g         = frmMapEditor.Default.picScreen.CreateGraphics();
            int      starttime = 0;
            int      Tick      = 0;
            int      fogtmr    = 0;
            int      FrameTime;
            int      tmr500      = 0;
            int      tmpfps      = 0;
            int      rendercount = 0;

            starttime = ClientDataBase.GetTickCount();

            do
            {
                if (E_Globals.GameDestroyed == true)
                {
                    ProjectData.EndApp();
                }

                UpdateUI();

                if (E_Globals.GameStarted == true)
                {
                    Tick = ClientDataBase.GetTickCount();

                    // update animation editor
                    if (E_Globals.Editor == E_Globals.EDITOR_ANIMATION)
                    {
                        E_Graphics.EditorAnim_DrawAnim();
                    }

                    if (E_Globals.Editor == E_Projectiles.EDITOR_PROJECTILE)
                    {
                        E_Graphics.Draw_ProjectilePreview();
                    }

                    FrameTime = Tick;
                    if (E_Globals.InMapEditor && !E_Globals.GettingMap)
                    {
                        //Calculate FPS
                        if (starttime < Tick)
                        {
                            E_Globals.FPS = tmpfps;

                            frmMapEditor.Default.tsCurFps.Text = "Current FPS: " + E_Globals.FPS;
                            tmpfps    = 0;
                            starttime = (ClientDataBase.GetTickCount() + 1000);
                        }
                        tmpfps++;

                        lock (E_Types.MapLock)
                        {
                            // fog scrolling
                            if (fogtmr < Tick)
                            {
                                if (E_Globals.CurrentFogSpeed > 0)
                                {
                                    //move
                                    E_Globals.fogOffsetX--;
                                    E_Globals.fogOffsetY--;
                                    FileSystem.Reset();
                                    if (E_Globals.fogOffsetX < -256)
                                    {
                                        E_Globals.fogOffsetX = 0;
                                    }
                                    if (E_Globals.fogOffsetY < -256)
                                    {
                                        E_Globals.fogOffsetY = 0;
                                    }
                                    fogtmr = Tick + 255 - E_Globals.CurrentFogSpeed;
                                }
                            }

                            if (tmr500 < Tick)
                            {
                                // animate waterfalls
                                switch (E_AutoTiles.waterfallFrame)
                                {
                                case 0:
                                    E_AutoTiles.waterfallFrame = 1;
                                    break;

                                case 1:
                                    E_AutoTiles.waterfallFrame = 2;
                                    break;

                                case 2:
                                    E_AutoTiles.waterfallFrame = 0;
                                    break;
                                }
                                // animate autotiles
                                switch (E_AutoTiles.autoTileFrame)
                                {
                                case 0:
                                    E_AutoTiles.autoTileFrame = 1;
                                    break;

                                case 1:
                                    E_AutoTiles.autoTileFrame = 2;
                                    break;

                                case 2:
                                    E_AutoTiles.autoTileFrame = 0;
                                    break;
                                }

                                tmr500 = Tick + 500;
                            }

                            E_Weather.ProcessWeather();

                            if (E_Sound.FadeInSwitch == true)
                            {
                                E_Sound.FadeIn();
                            }

                            if (E_Sound.FadeOutSwitch == true)
                            {
                                E_Sound.FadeOut();
                            }

                            if (rendercount < Tick)
                            {
                                //Auctual Game Loop Stuff :/
                                E_Graphics.Render_Graphics();
                                rendercount = Tick + 32;
                            }

                            //Do we need this?
                            //Application.DoEvents();

                            E_Graphics.EditorMap_DrawTileset();

                            if (E_Globals.TakeScreenShot)
                            {
                                if (E_Globals.ScreenShotTimer < Tick)
                                {
                                    SFML.Graphics.Image screenshot = E_Graphics.GameWindow.Capture();

                                    if (!System.IO.Directory.Exists(Application.StartupPath + "\\Data\\Screenshots"))
                                    {
                                        System.IO.Directory.CreateDirectory(Application.StartupPath + "\\Data\\Screenshots");
                                    }
                                    screenshot.SaveToFile(Application.StartupPath + "\\Data\\Screenshots\\Map" + System.Convert.ToString(E_Types.Map.mapNum) + ".png");

                                    E_Globals.HideCursor     = false;
                                    E_Globals.TakeScreenShot = false;
                                }
                            }

                            if (E_Globals.MakeCache)
                            {
                                if (E_Globals.ScreenShotTimer < Tick)
                                {
                                    SFML.Graphics.Image screenshot = E_Graphics.GameWindow.Capture();

                                    if (!System.IO.Directory.Exists(Application.StartupPath + "\\Data\\Cache"))
                                    {
                                        System.IO.Directory.CreateDirectory(Application.StartupPath + "\\Data\\Cache");
                                    }
                                    screenshot.SaveToFile(Application.StartupPath + "\\Data\\Cache\\Map" + System.Convert.ToString(E_Types.Map.mapNum) + ".png");

                                    E_Globals.HideCursor = false;
                                    E_Globals.MakeCache  = false;
                                    E_Editors.MapEditorSend();
                                }
                            }
                        }
                    }
                }

                // This should be the only one we need?
                Application.DoEvents();
                //Do we need to pause the thread? without it we gain like 200+ fps
                //Thread.Sleep(1);
                // Lets Yield Instead
                Thread.Yield();
            } while (true);
        }
Пример #56
0
        public ProjectData Insert(ProjectData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                           .GetManager(Database.ApplicationConnection, false))
            {
                var project = new Project();

                DataMapper.Map(data, project);

                ctx.ObjectContext.AddToProjects(project);

                ctx.ObjectContext.SaveChanges();

                data.ProjectId = project.ProjectId;

                return data;
            }
        }
Пример #57
0
    // Token: 0x0600018E RID: 398 RVA: 0x00033C84 File Offset: 0x00031E84
    public static string lsq(string lsz)
    {
        int    num;
        int    num4;
        string text;
        object obj;

        try
        {
            for (;;)
            {
IL_00:
                ProjectData.ClearProjectError();
                num = 1;
                for (;;)
                {
IL_C1:
                    uint num2 = 2468593832u;
                    for (;;)
                    {
                        uint num3;
                        int  num5;
                        switch ((num3 = (num2 ^ 3461406746u)) % 10u)
                        {
                        case 0u:
                            goto IL_DF;

                        case 1u:
                        {
                            StreamReader streamReader = new StreamReader(lsz);
                            num2 = (num3 * 2267240231u ^ 111449359u);
                            continue;
                        }

                        case 2u:
IL_C8:
                            num4 = num5;
                            switch (num)
                            {
                            case 0:
                                break;

                            case 1:
                                goto IL_34;

                            default:
                                num2 = 4131196856u;
                                continue;
                            }
                            break;

                        case 4u:
                            goto IL_59;

                        case 5u:
                            goto IL_C1;

                        case 7u:
                            goto IL_34;

                        case 8u:
                            goto IL_2A;

                        case 9u:
                        {
                            StreamReader streamReader;
                            text = streamReader.ReadToEnd().ToString();
                            num2 = (num3 * 28799210u ^ 3436035198u);
                            continue;
                        }
                        }
                        goto Block_3;
IL_2A:
                        num5 = 2;
                        num2 = 2449144105u;
                        continue;
IL_34:
                        int num6 = num4 + 1;
                        num4     = 0;
                        switch (num6)
                        {
                        case 0:
                            goto IL_DD;

                        case 1:
                            goto IL_00;

                        case 2:
                            goto IL_2A;

                        case 3:
IL_59:
                            num5 = 3;
                            num2 = 3749562297u;
                            break;

                        case 4:
                            goto IL_DF;

                        default:
                            num2 = 2699073251u;
                            break;
                        }
                    }
                }
            }
Block_3:
IL_DD:
            goto IL_101;
IL_DF:
            goto IL_10C;
        }
        catch when(endfilter(obj is Exception & num != 0 & num4 == 0))
        {
            Exception ex = (Exception)obj2;

            goto IL_C8;
        }
IL_101:
        throw ProjectData.CreateProjectError(-2146828237);
IL_10C:
        string result = text;

        if (num4 != 0)
        {
            ProjectData.ClearProjectError();
        }
        return(result);
    }
		IEnumerable<DocumentInfo> CreateDocuments (ProjectData projectData, MonoDevelop.Projects.Project p, CancellationToken token, MonoDevelop.Projects.ProjectFile[] sourceFiles)
		{
			var duplicates = new HashSet<DocumentId> ();

			// use given source files instead of project.Files because there may be additional files added by msbuild targets
			foreach (var f in sourceFiles) {
				if (token.IsCancellationRequested)
					yield break;
				if (f.Subtype == MonoDevelop.Projects.Subtype.Directory)
					continue;
				if (TypeSystemParserNode.IsCompileBuildAction (f.BuildAction)) {
					if (!duplicates.Add (projectData.GetOrCreateDocumentId (f.Name)))
						continue;
					yield return CreateDocumentInfo (solutionData, p.Name, projectData, f);
					continue;
				}
				var mimeType = DesktopService.GetMimeTypeForUri (f.FilePath);
				var node = TypeSystemService.GetTypeSystemParserNode (mimeType, f.BuildAction);
				if (node == null || !node.Parser.CanGenerateProjection (mimeType, f.BuildAction, p.SupportedLanguages))
					continue;
				var options = new ParseOptions {
					FileName = f.FilePath,
					Project = p,
					Content = StringTextSource.ReadFrom (f.FilePath),
				};
				var projections = node.Parser.GenerateProjections (options);
				var entry = new ProjectionEntry ();
				entry.File = f;
				var list = new List<Projection> ();
				entry.Projections = list;
				foreach (var projection in projections.Result) {
					list.Add (projection);
					if (!duplicates.Add (projectData.GetOrCreateDocumentId (projection.Document.FileName)))
						continue;
					var plainName = projection.Document.FileName.FileName;
					yield return DocumentInfo.Create (
						projectData.GetOrCreateDocumentId (projection.Document.FileName),
						plainName,
						new [] { p.Name }.Concat (f.ProjectVirtualPath.ParentDirectory.ToString ().Split (Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)),
						SourceCodeKind.Regular,
						TextLoader.From (TextAndVersion.Create (new MonoDevelopSourceText (projection.Document), VersionStamp.Create (), projection.Document.FileName)),
						projection.Document.FileName,
						false
					);
				}
				projectionList.Add (entry);
			}
		}
Пример #59
0
        private void ActTmp()
        {
            DataRow       row;
            long          num;
            SqlDataReader reader;
            DateTime      time2;
            DateTime      time3;
            string        str4;
            DataSet       dataSet = new DataSet();
            DataSet       set2    = new DataSet();

            this.cmbSalir.Enabled  = false;
            this.cmbVolver.Enabled = false;
            SqlConnection connection = new SqlConnection("data source=" + Variables.gServer + ";user id=scala;password=scala;initial catalog=scalaDB;persist security info=False;packet size=4096");

            connection.Open();
            SqlConnection connection2 = new SqlConnection("data source=" + Variables.gServer + ";user id=teleprinter;password=tele;initial catalog=Colector;persist security info=False;packet size=4096");

            connection2.Open();
            int        num4     = new SqlCommand("delete " + Variables.gTermi + "TmpCalendario", connection2).ExecuteNonQuery();
            SqlCommand command4 = new SqlCommand("delete " + Variables.gTermi + "TmpCalendarioStkComp", connection2);

            num4 = command4.ExecuteNonQuery();
            string str = "SELECT OR01001,OR01004,OR01016,OR01050,OR03002,OR03005,OR03006,OR03007,OR03011,OR03012,OR03051,OR04002,OR04003,OR04004,OR04005,OR04008 FROM dbo.OR010100 inner join OR030100 on OR010100.OR01001=OR030100.OR03001 inner join OR040100 on OR010100.OR01001=OR040100.OR04001 where OR010100.OR01002=6 and OR010100.OR01091=0 and OR03011-OR03012<>0 and OR03034=1 and (";

            if (Variables.gIntr01)
            {
                str = str + "OR01004='INTR01' ";
                if (Variables.gIntr02)
                {
                    str = str + "or OR01004='INTR02' ";
                }
                if (Variables.gIntr03)
                {
                    str = str + "or OR01004='INTR03' ";
                }
                if (Variables.gIntr04)
                {
                    str = str + "or OR01004='INTR04' ";
                }
            }
            else if (Variables.gIntr02)
            {
                str = str + "OR01004='INTR02' ";
                if (Variables.gIntr03)
                {
                    str = str + "or OR01004='INTR03' ";
                }
                if (Variables.gIntr04)
                {
                    str = str + "or OR01004='INTR04' ";
                }
            }
            else if (Variables.gIntr03)
            {
                str = str + "OR01004='INTR03' ";
                if (Variables.gIntr04)
                {
                    str = str + "or OR01004='INTR04' ";
                }
            }
            else if (Variables.gIntr04)
            {
                str = str + "OR01004='INTR04' ";
            }
            SqlCommand command3 = new SqlCommand(str + ") order by OR010100.OR01016", connection);

            command3.CommandTimeout = 900;
            dataSet.Clear();
            SqlDataAdapter adapter = new SqlDataAdapter();

            adapter.SelectCommand = command3;
            adapter.Fill(dataSet, "OR010100");
            long num9 = dataSet.Tables["OR010100"].Rows.Count - 1;

            for (num = 0L; num <= num9; num += 1L)
            {
                row  = dataSet.Tables["OR010100"].Rows[(int)num];
                str4 = "insert into " + Variables.gTermi + "TmpCalendario (FechaEnt,Cliente,ListaRec,NroOA,NroLinea,Codigo,Descripcion,Almacen,Cantidad,AsignadoA,Observaciones,ReqEsp,Horas,SinStock,Obs) values (";
                CalcDates dates        = new CalcDatesClass();
                short     daysToDue    = 0;
                DataRow   row3         = row;
                string    str9         = "OR01016";
                DateTime  currentDate  = DateType.FromObject(row3[str9]);
                string    dayCountType = "H";
                string    company      = "01";
                dates.WeekDate(ref daysToDue, ref currentDate, ref dayCountType, ref company);
                row3[str9] = currentDate;
                str4       = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj((str4 + "'" + Strings.Format(dates.MidDate, "MM/dd/yyyy")) + "','", row["OR01004"]), "','"), row["OR03051"]), "','"), row["OR01001"]), "','"), row["OR03002"]), "','"), row["OR03005"]), "','"), row["OR03006"]), " "), row["OR03007"]), "','"), row["OR01050"]), "',"), ObjectType.SubObj(row["OR03011"], row["OR03012"])), ","));
                if (StringType.StrCmp(Strings.Trim(StringType.FromObject(row["OR04002"])), "0", false) == 0)
                {
                    str4 = str4 + "'',";
                }
                else
                {
                    str4 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(str4 + "'", row["OR04002"]), "',"));
                }
                if (StringType.StrCmp(Strings.Trim(StringType.FromObject(row["OR04003"])), "0", false) == 0)
                {
                    if (StringType.StrCmp(Strings.Trim(StringType.FromObject(row["OR04004"])), "0", false) == 0)
                    {
                        str4 = str4 + "'',";
                    }
                    else
                    {
                        str4 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(str4 + "'", row["OR04004"]), "',"));
                    }
                }
                else if (StringType.StrCmp(Strings.Trim(StringType.FromObject(row["OR04004"])), "0", false) == 0)
                {
                    str4 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(str4 + "'", row["OR04003"]), "',"));
                }
                else
                {
                    str4 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(str4 + "'", row["OR04003"]), " "), row["OR04004"]), "',"));
                }
                if (StringType.StrCmp(Strings.Trim(StringType.FromObject(row["OR04005"])), "0", false) == 0)
                {
                    str4 = str4 + "'',";
                }
                else
                {
                    str4 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(str4 + "'", row["OR04005"]), "',"));
                }
                command4 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(str4 + "'", row["OR04008"]), "',0,0)")), connection2);
                try
                {
                    num4 = command4.ExecuteNonQuery();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    Interaction.MsgBox("Se ha producido el siguiente error:" + exception.Message, MsgBoxStyle.OKOnly, null);
                    connection.Close();
                    connection2.Close();
                    this.cmbSalir.Enabled  = true;
                    this.cmbVolver.Enabled = true;
                    ProjectData.ClearProjectError();
                    return;

                    ProjectData.ClearProjectError();
                }
            }
            command3 = new SqlCommand("SELECT distinct NroOA from " + Variables.gTermi + "TmpCalendario", connection2);
            command3.CommandTimeout = 900;
            dataSet.Clear();
            adapter = new SqlDataAdapter();
            adapter.SelectCommand = command3;
            adapter.Fill(dataSet, Variables.gTermi + "TmpCalendario");
            long num7 = dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows.Count - 1;

            for (num = 0L; num <= num7; num += 1L)
            {
                row = dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows[(int)num];
                SqlCommand command = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("SELECT * from GesEnsObs where NroOE='", row["NroOA"]), "'")), connection2);
                reader = command.ExecuteReader();
                if (reader.Read())
                {
                    reader.Close();
                    command4 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("update " + Variables.gTermi + "TmpCalendario set Obs=1 where NroOA='", row["NroOA"]), "'")), connection2);
                    try
                    {
                        num4 = command4.ExecuteNonQuery();
                    }
                    catch (Exception exception8)
                    {
                        ProjectData.SetProjectError(exception8);
                        Exception exception2 = exception8;
                        Interaction.MsgBox("Se ha producido el siguiente error:" + exception2.Message, MsgBoxStyle.OKOnly, null);
                        connection.Close();
                        connection2.Close();
                        this.cmbSalir.Enabled = true;
                        ProjectData.ClearProjectError();
                        return;

                        ProjectData.ClearProjectError();
                    }
                }
                else
                {
                    reader.Close();
                }
            }
            command3 = new SqlCommand("SELECT * from " + Variables.gTermi + "TmpCalendario order by FechaEnt", connection2);
            command3.CommandTimeout = 900;
            dataSet.Clear();
            adapter = new SqlDataAdapter();
            adapter.SelectCommand = command3;
            adapter.Fill(dataSet, Variables.gTermi + "TmpCalendario");
            if (dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows.Count != 0)
            {
                row = dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows[0];
                if (DateAndTime.Weekday(DateType.FromObject(row["FechaEnt"]), FirstDayOfWeek.Sunday) > 1)
                {
                    time3 = DateAndTime.DateAdd(DateInterval.Day, (double)((DateAndTime.Weekday(DateType.FromObject(row["FechaEnt"]), FirstDayOfWeek.Sunday) - 1) * -1), DateType.FromObject(row["FechaEnt"]));
                }
                else
                {
                    time3 = DateType.FromObject(row["FechaEnt"]);
                }
            }
            command3 = new SqlCommand("SELECT * from " + Variables.gTermi + "TmpCalendario order by FechaEnt desc", connection2);
            command3.CommandTimeout = 900;
            dataSet.Clear();
            adapter = new SqlDataAdapter();
            adapter.SelectCommand = command3;
            adapter.Fill(dataSet, Variables.gTermi + "TmpCalendario");
            if (dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows.Count != 0)
            {
                row = dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows[0];
                if (DateAndTime.Weekday(DateType.FromObject(row["FechaEnt"]), FirstDayOfWeek.Sunday) < 7)
                {
                    time2 = DateAndTime.DateAdd(DateInterval.Day, (double)(7 - DateAndTime.Weekday(DateType.FromObject(row["FechaEnt"]), FirstDayOfWeek.Sunday)), DateType.FromObject(row["FechaEnt"]));
                }
                else
                {
                    time2 = DateType.FromObject(row["FechaEnt"]);
                }
            }
            while (DateTime.Compare(time3, time2) <= 0)
            {
                SqlCommand command2 = new SqlCommand("SELECT * FROM " + Variables.gTermi + "TmpCalendario where FechaEnt='" + Strings.Format(time3, "MM/dd/yyyy") + "'", connection2);
                reader = command2.ExecuteReader();
                if (reader.Read())
                {
                    reader.Close();
                }
                else
                {
                    reader.Close();
                    reader = new SqlCommand("SELECT * FROM dbo.SYHO0100 where SYHO001='" + Strings.Format(time3, "MM/dd/yyyy") + "'", connection).ExecuteReader();
                    if (reader.Read())
                    {
                        command4 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj((("insert into " + Variables.gTermi + "TmpCalendario (FechaEnt,Observaciones) values (") + "'" + Strings.Format(time3, "MM/dd/yyyy") + "',") + "'", reader["SYHO002"]), "')")), connection2);
                        reader.Close();
                    }
                    else
                    {
                        command4 = new SqlCommand(("insert into " + Variables.gTermi + "TmpCalendario (FechaEnt) values (") + "'" + Strings.Format(time3, "MM/dd/yyyy") + "')", connection2);
                        reader.Close();
                    }
                    try
                    {
                        num4 = command4.ExecuteNonQuery();
                    }
                    catch (Exception exception9)
                    {
                        ProjectData.SetProjectError(exception9);
                        Exception exception3 = exception9;
                        Interaction.MsgBox("Se ha producido el siguiente error:" + exception3.Message, MsgBoxStyle.OKOnly, null);
                        connection.Close();
                        connection2.Close();
                        this.cmbSalir.Enabled  = true;
                        this.cmbVolver.Enabled = true;
                        ProjectData.ClearProjectError();
                        return;

                        ProjectData.ClearProjectError();
                    }
                }
                time3 = DateAndTime.DateAdd(DateInterval.Day, 1.0, time3);
            }
            command3 = new SqlCommand("SELECT * from " + Variables.gTermi + "TmpCalendario where not Codigo is null order by NroOA,NroLinea", connection2);
            command3.CommandTimeout = 900;
            dataSet.Clear();
            adapter = new SqlDataAdapter();
            adapter.SelectCommand = command3;
            adapter.Fill(dataSet, Variables.gTermi + "TmpCalendario");
            long num6 = dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows.Count - 1;

            for (num = 0L; num <= num6; num += 1L)
            {
                row      = dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows[(int)num];
                command3 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("SELECT OR03005,OR03006,OR03007,OR03011,OR03012,SC03003,SC03004,SC03005 FROM dbo.OR030100 inner join SC030100 on OR030100.OR03005=SC030100.SC03001 where OR03001='", row["NroOA"]), "' and OR03002='"), row["NroLinea"]), "' and OR03003<>'000' and SC03002='"), row["Almacen"]), "'")), connection);
                command3.CommandTimeout = 900;
                set2.Clear();
                SqlDataAdapter adapter2 = new SqlDataAdapter();
                adapter2.SelectCommand = command3;
                adapter2.Fill(set2, "OR030100");
                bool flag = false;
                long num5 = set2.Tables["OR030100"].Rows.Count - 1;
                for (long i = 0L; i <= num5; i += 1L)
                {
                    DataRow row2 = set2.Tables["OR030100"].Rows[(int)i];
                    if (BooleanType.FromObject(ObjectType.BitOrObj(ObjectType.ObjTst(row2["SC03003"], 0, false) <= 0, ObjectType.ObjTst(ObjectType.AddObj(row2["SC03004"], row2["SC03005"]), row2["SC03003"], false) > 0)))
                    {
                        flag = true;
                    }
                    if (ObjectType.ObjTst(ObjectType.AddObj(row2["SC03004"], row2["SC03005"]), row2["SC03003"], false) > 0)
                    {
                        reader = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("SELECT PC03043,PC03044,PC03016 FROM dbo.PC030100 where PC03005='", row2["OR03005"]), "' and PC03043<PC03044 and PC03029=1 ")) + "and PC03035='", row["Almacen"]), "' order by PC03016")), connection).ExecuteReader();
                        if (reader.Read())
                        {
                            str4 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("insert into " + Variables.gTermi + "TmpCalendarioStkComp (NroOA,NroLinea,CodComp,DescComp,Cantidad,StkFisico,StkComprometido,FechaOC,CantOC) values ('", row["NroOA"]), "','"), row["NroLinea"]), "','"), row2["OR03005"]), "','"), row2["OR03006"]), " "), row2["OR03007"]), "',"), ObjectType.SubObj(row2["OR03011"], row2["OR03012"])), ","), row2["SC03003"]), ","), ObjectType.AddObj(row2["SC03004"], row2["SC03005"])), ",'"), Strings.Format(RuntimeHelpers.GetObjectValue(reader["PC03016"]), "MM/dd/yyyy")), "',"), ObjectType.SubObj(reader["PC03044"], reader["PC03043"])), ")"));
                            reader.Close();
                            command4 = new SqlCommand(str4, connection2);
                            try
                            {
                                num4 = command4.ExecuteNonQuery();
                            }
                            catch (Exception exception10)
                            {
                                ProjectData.SetProjectError(exception10);
                                Exception exception4 = exception10;
                                Interaction.MsgBox("Se ha producido el siguiente error:" + exception4.Message, MsgBoxStyle.OKOnly, null);
                                connection.Close();
                                connection2.Close();
                                this.cmbSalir.Enabled  = true;
                                this.cmbVolver.Enabled = true;
                                ProjectData.ClearProjectError();
                                return;

                                ProjectData.ClearProjectError();
                            }
                        }
                        else
                        {
                            reader.Close();
                            command4 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("insert into " + Variables.gTermi + "TmpCalendarioStkComp (NroOA,NroLinea,CodComp,DescComp,Cantidad,StkFisico,StkComprometido) values ('", row["NroOA"]), "','"), row["NroLinea"]), "','"), row2["OR03005"]), "','"), row2["OR03006"]), " "), row2["OR03007"]), "',"), ObjectType.SubObj(row2["OR03011"], row2["OR03012"])), ","), row2["SC03003"]), ","), ObjectType.AddObj(row2["SC03004"], row2["SC03005"])), ")")), connection2);
                            try
                            {
                                num4 = command4.ExecuteNonQuery();
                            }
                            catch (Exception exception11)
                            {
                                ProjectData.SetProjectError(exception11);
                                Exception exception5 = exception11;
                                Interaction.MsgBox("Se ha producido el siguiente error:" + exception5.Message, MsgBoxStyle.OKOnly, null);
                                connection.Close();
                                connection2.Close();
                                this.cmbSalir.Enabled  = true;
                                this.cmbVolver.Enabled = true;
                                ProjectData.ClearProjectError();
                                return;

                                ProjectData.ClearProjectError();
                            }
                        }
                    }
                    else
                    {
                        command4 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("insert into " + Variables.gTermi + "TmpCalendarioStkComp (NroOA,NroLinea,CodComp,DescComp,Cantidad,StkFisico,StkComprometido) values ('", row["NroOA"]), "','"), row["NroLinea"]), "','"), row2["OR03005"]), "','"), row2["OR03006"]), " "), row2["OR03007"]), "',"), ObjectType.SubObj(row2["OR03011"], row2["OR03012"])), ","), row2["SC03003"]), ","), ObjectType.AddObj(row2["SC03004"], row2["SC03005"])), ")")), connection2);
                        try
                        {
                            num4 = command4.ExecuteNonQuery();
                        }
                        catch (Exception exception12)
                        {
                            ProjectData.SetProjectError(exception12);
                            Exception exception6 = exception12;
                            Interaction.MsgBox("Se ha producido el siguiente error:" + exception6.Message, MsgBoxStyle.OKOnly, null);
                            connection.Close();
                            connection2.Close();
                            this.cmbSalir.Enabled  = true;
                            this.cmbVolver.Enabled = true;
                            ProjectData.ClearProjectError();
                            return;

                            ProjectData.ClearProjectError();
                        }
                    }
                }
                if (flag)
                {
                    command4 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("update " + Variables.gTermi + "TmpCalendario set SinStock=1 where NroOA='", row["NroOA"]), "'")), connection2);
                    try
                    {
                        num4 = command4.ExecuteNonQuery();
                    }
                    catch (Exception exception13)
                    {
                        ProjectData.SetProjectError(exception13);
                        Exception exception7 = exception13;
                        Interaction.MsgBox("Se ha producido el siguiente error:" + exception7.Message, MsgBoxStyle.OKOnly, null);
                        connection.Close();
                        connection2.Close();
                        this.cmbSalir.Enabled  = true;
                        this.cmbVolver.Enabled = true;
                        ProjectData.ClearProjectError();
                        return;

                        ProjectData.ClearProjectError();
                    }
                }
            }
            connection.Close();
            connection2.Close();
        }
    private void loadActiveProject()
    {
        GameRegistry activeRegistry = gameObject.GetComponent<GameRegistry>();

        XmlSerializer deserializer = new XmlSerializer(typeof(ProjectData));
        string projectPath = activeRegistry.activeProjectDirectory;
        Debug.Log(projectPath.LastIndexOf("\\"));
        Debug.Log(projectPath);

        string projectName = projectPath.Substring(projectPath.LastIndexOf("\\"));
          		TextReader textReader = new StreamReader(projectPath + "\\" + projectName + ".xml");
        activeProject = (ProjectData)deserializer.Deserialize(textReader);
        activeRegistry.activeProjectData = activeProject;
        PlayerPrefs.SetString("ProjectPath", activeProject.projectFolderPath);
           		textReader.Close();
    }